Newbie question: LED's won't go off ...
ZebZiggle
Posts: 3
Hi, I'm using a BS2-SX with an older Activity Board (the one with all the buttons, speaker, etc.)
I whipped up a really simple program to flash the LED's
But the LED's all stay on at the end ... however they do flash during the inner loop?! Odd. Even the forced "Low's" at the end fail to make the LED's go off.
Also, the board seems to blink about every 2 seconds after the END. P11 is hooked up to the speaker, so you hear a little "tick" about every 2 secs and all the LED's flicker.
Any idea what's going on here? Is it something with my code or a quirk of the activity board?
I whipped up a really simple program to flash the LED's
' {$STAMP BS2sx} ' {$PBASIC 2.5} counter VAR Byte light VAR Byte FOR light = 8 TO 11 FOR counter = 1 TO 5 DEBUG DEC light, DEC counter, ",", CR HIGH light PAUSE 500 LOW light PAUSE 500 NEXT NEXT DEBUG "Done" LOW 8 LOW 9 LOW 10 LOW 11 END
But the LED's all stay on at the end ... however they do flash during the inner loop?! Odd. Even the forced "Low's" at the end fail to make the LED's go off.
Also, the board seems to blink about every 2 seconds after the END. P11 is hooked up to the speaker, so you hear a little "tick" about every 2 secs and all the LED's flicker.
Any idea what's going on here? Is it something with my code or a quirk of the activity board?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Info on all kinds of robosports:
www.freewebs.com/robotbattles
As for the blink every 2 seconds, I think the END statement actually puts the stamp to sleep where it wake up every 1.8 seconds causing the "blips". Use STOP instead of END to prevent this.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
Jimmio, it's using a brick power supply, so it's not a battery issue.
Bean, the LED's were pre-assembled on the Activity board (like I said, it's an old board), so the led's can easily be flipped. Not only that, they *do* blink during the inner loop. They just end up always in the ON state, even with the explicit LOW.
I'll try the STOP command and see what that does ... makes sense though. Thx!
Cheers,
-Z
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
To be sure - ask Parallax guys.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Seems the activity board is active high on all pins on reset.
I changed my code accordingly and everything works fine now.
The 2.3 sec flicker is a documented feature under the END/STOP section. I just didn't know there were two commands to achieve essentially the same result.
Now ... onto trickier problems!