
Originally Posted by
WarPony
I was refering to my button command. Should I start the port high and pull it low or start low and pull high based on this bit of code?
Code:
delay = 0
Button Temp_Up, 0, 255, 0, delay, 0, Up_Loop
button Temp_Down, 0, 255, 0, delay, 0, Down_Loop
Up_Loop:
If Temp_Up = 0 Then
Setpoint = Setpoint + 1
lcdout $fe, 1, "Setpoint = ", Setpoint
Pause 1000
Else
Goto Start_Convert
Endif
Goto Up_Loop
Down_Loop:
If Temp_Down = 0 Then
Setpoint = Setpoint - 1
lcdout $fe, 1, "Setpoint = ", Setpoint
Pause 1000
Else
Goto Start_Convert
Endif
Goto Down_Loop
Hello WarPony,
You have written your code, If X=0 true, then do something, so you would pull the ports up to supply + with a resistor or WPUs, and the if / then loop would be true when the switch grounds it. Did I answer the right question or are you asking which way is better ?
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