Why doesn't this code work?
mike_s
Posts: 42
Update_display:
··· OUTH = 132
··· LOW rs
··· PULSOUT e, 1
··· OUTH = char
··· HIGH rs
··· PULSOUT e, 1
132· = the 5th pos from home in display which works
However it will only print a literal value in quotes (eg "1" will update as 1)
Why won't it accept a variable which holds a value from 1-9
and print that number
··· OUTH = 132
··· LOW rs
··· PULSOUT e, 1
··· OUTH = char
··· HIGH rs
··· PULSOUT e, 1
132· = the 5th pos from home in display which works
However it will only print a literal value in quotes (eg "1" will update as 1)
Why won't it accept a variable which holds a value from 1-9
and print that number
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
e = pin 6 enable
char = character to be sent
if I look up the character for 1 in binary it would be %00110001 but that won't work in this case because I want to print each update to a counter in decimal.
I want to be able to send the value in decimal to print like in a string eg "A" or "1" literally
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Looks like the lcd controller only understands either binary or strings as asc11 characters.
What I want to do is update the lcd by a counter.
At least looking at the character chart for it 0-9 do follow eachother in the lsb
but they start at 0011 in the msb.
eg 0 = 00110000
1 = 00110001
2 = 00110010 etc
I think I might have just realised what is needed.
If I add 48 to the binary value then it should print the value I'm after?
While not an atomic clock it might do as a token timer for an app where precision isn't too important.
I monitored for a few minutes and its pretty close. But for precise timing I imagine either a 555 timer or ds1307(which I've seen mentioned here would prolly do it.
Could someone point me in the right direction with 555 timers and basic stamp time keeping?
I have plenty off 555 and 556's but don't have a ds1307 which I've found to be much more expensive anyaway.
Just have to finish the rest of it now.
will post it if anyone interested when I'm done