thank you so much joe,its good i got more ideas from that thread you added,see you soon joe
thank you so much joe,its good i got more ideas from that thread you added,see you soon joe
hi again joe.
im trying to make a counter from 0 to 9999, i want to use the same code u fixed for me' well i use 74hc164 and 4 digit l7segment leds now i want to write a variables for 4 digits and shiftout, if it will works please im putin digits in porta.0 to 3, im confused how to use a variable works with shiftout, have a great day Joe .!
' I2CREAD and I2WRITE Commands
Include "modedefs.bas"
DEFINE SHIFT_PAUSEUS 1000
SDO VAR PortB.0
SCLK var PortB.1
SCLK = 8
DPIN var PORTA.0
CPIN var PORTA.1
B0 var byte
B1 var byte
B2 var byte
N var byte
portB = 0
TRISB = 0
pause 100
For B2 = 0 To 9
lookup b2,[252,96,218,242,102,182,190,224,254,246],b0
I2CWRITE DPIN,CPIN,$A0,b2,[ b0]
Pause 20
Next B2
loop: For B3 = 0 To 9
I2CREAD DPIN,CPIN,$A0,b3,[B1]
pause 1000
SHiftOUT SDO,SCLK,0,[b1]
'
Next B3
Goto loop
end
Last edited by malwww; - 12th May 2009 at 18:03.
Hi malwww,
are you using the eeprom in this counter or just a display? Are you wanting to load count into eeprom and then display the results or just count to 9999? Am I correct in assuming SDO & SCLK are for the display ?
It is pretty easy once you get the hang of it, overflow your counter variable into another variable and sort @ display time using the DIG statement. Look at this thread to see how, post #9 is where I posted the code to which I refer. http://www.picbasic.co.uk/forum/showthread.php?t=9037
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
hi joe im using the eeprom to save data and count them,just want to know how to vary the digits when enable digit 1 it shift out the data or number to digit 1 then digit 2 so on and remember im using shiftout to 74hc164 to drive 7 sigment digits,i want to drive 4 digit with shiftout, i will check this thread you gaved me thank you so much joe
Last edited by malwww; - 12th May 2009 at 23:32.
I buy 4 digit displays from http://www.sureelectronics.net/ , usually through their eBay store. For about 15 US you get an spi display that works exactly with the code in your lookup table and it is about 32mm tall, 1 1/2 inches tall. These displays can be hooked together using cables supplied with them to make several digit displays. BTW, God helps us every day, that's why we do not starve.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
hello joe i wrote this code now it works the 7segment and shiftout .but when i vary things it doesnt works and it doesnt show me things, i want to know where i put a variables and how, is pic cant run 2 things in the same times ? (variables and shiftout with digit out) and i keep the shiftout how it is now , please help now it show me 3210 on leds 7segments ,sorry i cant find lcds in my country and i cant send money to buy from europ or usa bcz they dont alow us to send money out, i need to call my friends in spain to buy me them but it will take long 'now im new in pbp i want to learn a bit good and sorry about my english , thank you joe
' I2CREAD and I2WRITE Commands
Include "modedefs.bas"
'DEFINE SHIFT_PAUSEUS 1
DEFINE OSC 4
SDO VAR PortB.0
SCLK var PortB.1
DPIN var PORTA.0
CPIN var PORTA.1
B0 var byte
B1 var byte
B2 var byte
B3 var byte
B4 var byte
symbol Digit_1 = portb.4
symbol Digit_2 = portb.5
symbol Digit_3 = portb.6
symbol Digit_4 = portb.7
SCLK = 8
TRISB = 0
' i did a variable here lookup or read but it dont work or shiftout,
main:
Digit_2 = 1
Digit_3 = 1
digit_4 = 1
SHiftOUT SDO,SCLK,0,[252]
Digit_1 = 0
pause 1
Digit_1 = 1
Digit_3 = 1
digit_4 = 1
SHiftOUT SDO,SCLK,0,[96]
Digit_2 = 0
pause 1
Digit_1 = 1
Digit_2 = 1
digit_4 = 1
SHiftOUT SDO,SCLK,0,[218]
Digit_3 = 0
pause 1
Digit_1 = 1
Digit_2 = 1
digit_3= 1
SHiftOUT SDO,SCLK,0,[242]
Digit_4 = 0
pause 1
goto main
end
Last edited by malwww; - 13th May 2009 at 18:17.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks