Need some help!!
silence00
Posts: 1
in BASIC Stamp
Hey there. Fairly new to pbasic, but I need it for a project. I'm trying to make my counter increase 1 every time I press my pushbutton, but can't seem to get my head wrapped around the code. Can somebody lend me a fresh brain? Stamp bs2, pbasic 2.5
Comments
Look at page 79 of "What's a Microcontroller?".
https://www.parallax.com/sites/default/files/downloads/28123-Whats-a-Micro-v3.0.pdf
There are many ways to scan buttons depending on the goal. There is also the PBASIC BUTTON command, but that is total overkill unless you want the repeat function.
A reference:
http://emesystems.com/OLDSITE/BS2fsm.htm#counter
You can continue this for as many states as you need. You could have a second button that takes you back to state000 or whatever you want.
You can also digitally borrow many books for free from openlibrary.org. I've had luck there with older technical books.