I/O function
Lets say that I wanted to have a dedicated I/O pin on an SX28 connected to a momentary pushbutton, that when pushed would cycle through (in order) , lets say, 5 different lines of code, one at a time, each push of the button would interrupt, and execute the next line (or lines) until pushed again. As in,
·When power comes on, the last set of lines that were running would begin running and continue until button is pressed, then the next set, until button is pushed, then the next set, and so on..................?????????????????????????????????
·When power comes on, the last set of lines that were running would begin running and continue until button is pressed, then the next set, until button is pushed, then the next set, and so on..................?????????????????????????????????
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Teacher: What is the difference between ignorance and apathy ?
Student: I don't know and I don't care
Teacher: Correct !
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
This doesn't debounce the button -- but it gives you an idea to get you started.
I am not that good with sx code yet so give me that inside of a complete set please
You have to declare the subroutine, of course. Instead of me writing a whole program for you, please crack open the help file or read the draft of "Practical SX/B" that's been posted.
The link has the code in it a few posts down:
http://forums.parallax.com/showthread.php?p=660476
Good luck.