I started with a much larger byte, but have reduced the code to this little nibble. It is still not working correctly. in0 is tied to SW2. My guess is that on planet earth the counter variable would increase by 1 for each press of sw2. I may be missing something though. Is the "animate" function buggy? What about the debugging function in general? I have also had several hangs where I had to re-download the program just to get the the debugger reading again. I am using Studio 1.0.0.15 with a Nano 40 on a Nano Dev Board. Computer is Intel C2 6600 @ 2.4GHz, 3.37GB Ram, Win XP Pro SP3. I have replaced the batteries with brand new ones, with a total voltage over 6V.
Code:
cr con 13 ;carriage return
counter var byte ;counter variable
counter = 0 ;set counter to 0
Main
if (in0 = 0) then Mode_State ;check for button press
Goto Main
Mode_State
counter = counter + 1 ;increase counter for each button press
debounce
if (in0 = 0) then debounce ;debounce button press
pause 30
debug [dec3 counter, cr] ;display counter
return
Multiple button presses return...
Code:
2
3
1
2
1