How do i write code to create a means of storing a setpoint that can be incremented or decremented using buttons?
How do i write code to create a means of storing a setpoint that can be incremented or decremented using buttons?
First setup some variables
Then the button VARsCode:cnt var byte TSET var byte TS var byte TLOG var byte
This reads the eeprom at start upCode:TUP var PORTD.0 TDOWN var PORTC.3
Then the codeCode:read TLOG, TSET TS = TSET
Code:START: if TUP = 1 then gosub T_UP if TDOWN = 1 then gosub T_DOWN GOTO START T_UP: for cnt = 1 to 1 TS = TS + 1 write TLOG, TS read TLOG, TSET pause 100 next return T_DOWN: for cnt = 1 to 1 TS = TS - 1 write TLOG, TS read TLOG, TSET pause 100 next return
Dave
Always wear safety glasses while programming.
ok that seems kewl. bt what if i had a high setpoint and a low setpoint and i wanted to use another two buttons, one to access the high setpoint then once the user has entered a value, the user could press the same button to exit and return to the main screen? the same goes for the other button.. im really pulling my hair off with trying to figure this out
Last edited by Kalind; - 8th October 2008 at 14:09.
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.
Hey Joe,
Have you tried miracle grow?
Kalind,
This might be the thread Joe is referring to.
http://www.picbasic.co.uk/forum/showthread.php?t=3600
If you use it. Read the value of Time and goto where ever from there.
When that bit of code is ran, set Time back to 0 for the next run.Code:IF Time = 3 THEN ??? IF Time = 9 THEN ?!?!
Oh, and if you have more questions, add a post to the thread, that way people that are working with you get an update in their e-mail. No e-mails for editing. I did not see you added more to the post until Joe replied.
Dave
Always wear safety glasses while programming.
NOPE ! I was referring to Melanie's Olympic timer. I had hoped Kalind would get busy and search for it. Ambition feeds the helpers. Anyway here is the link to her PDF file . . .http://www.picbasic.co.uk/forum/atta...4&d=1091819883
Look at how She used buttons to do different functions.
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