Can anyone help me complete the following routine?
A single push to a button switches LED ON ( IF pin0 = 1 THEN ) and remains like this untill button is pushed again, making LED go OFF. On same entry.
NB. I tried doing it like this, at +5V in on leg 11 LED ON goes on
Using: PICAXE-28X - 4Mhz
How could a routine like this look in Basic-code?
I've been working with the Basic-codes below, but have not been able to make it work.
<code><pre><font size=2 face='Courier'>
;Interrupts Button Pushed
WaitForPin0High:
SERTXD("Led OFF",CR,LF)
IF pin0 = 0 THEN WaitForPin0High
SERTXD("Led ON",CR,LF)
High 0
Pause 5000
Goto WaitForPin0High
</font></pre></code>
Best regards
Monie
A single push to a button switches LED ON ( IF pin0 = 1 THEN ) and remains like this untill button is pushed again, making LED go OFF. On same entry.
NB. I tried doing it like this, at +5V in on leg 11 LED ON goes on
Using: PICAXE-28X - 4Mhz
How could a routine like this look in Basic-code?
I've been working with the Basic-codes below, but have not been able to make it work.
<code><pre><font size=2 face='Courier'>
;Interrupts Button Pushed
WaitForPin0High:
SERTXD("Led OFF",CR,LF)
IF pin0 = 0 THEN WaitForPin0High
SERTXD("Led ON",CR,LF)
High 0
Pause 5000
Goto WaitForPin0High
</font></pre></code>
Best regards
Monie