LED problem: PulseBothLEDs.bs2
legoman35515
Posts: 1
the manual pg 56 says this program is supposed to blink the LEDs simotaneously... mine blink one after the other.
here is a copy of my code...
'Robotics with the Boe-Bot - PulseBothLeds.bs2
'Sends a 0.13 second pulse to the LED circuit connected to P13 and P12 every 2 s.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Program Running"
DO
·PULSOUT 13,65000
·PULSOUT 12,65000
·PAUSE 2000
LOOP
What am I doing wrong?
here is a copy of my code...
'Robotics with the Boe-Bot - PulseBothLeds.bs2
'Sends a 0.13 second pulse to the LED circuit connected to P13 and P12 every 2 s.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Program Running"
DO
·PULSOUT 13,65000
·PULSOUT 12,65000
·PAUSE 2000
LOOP
What am I doing wrong?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
For that fast flashing there is special kind of LED is used which is superior then that. What are u using right now.
Thats why u are not able to see the flashing.
What special LED would·you be referring to?
Please clean up your·text and grammar. It's·almost unreadable.
Jim
Post Edited (hover1) : 6/20/2010 11:44:40 PM GMT
Because the BS2 can only do one thing at a time, it has to process the ·"PULSOUT 13,65000" first before it can move on to the next instruction, which is "PULSOUT 12,65000", hence the delay from the first LED lighting to the second. The program runs as it should. The description probably·threw you off.
Push on with your experiments. That was a good question. Come back with any more.
Jim
EXAMPLE
DEBUG "Program Running"
DO
PULSOUT 13, 65000 PULSOUT 13, 65000
LOOP
'{$STAMP BS2}
'{$PBASIC 2.5}
Do
HIGH 13,
PAUSE 2600 ' 2.6 second pause
LOW 13
HIGH 12
PAUSE 2600 ' 2.6 second pause
LOW 12
LOOP
This is assuming you simply have two LED wired from pins 12 and 13 to ground.
Note that the pause is reduced to 2600 not 26000. Pause works on 1000ths of a second thus 1/0000 sec. x 2600 = 2.6 seconds.
the lights should alternate with a w.6 second duration. Hope this helps as an alternative. EQ.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
EverQurious
Try not to fret and worry bout the things that you have not...
Just remember to be thankful for the things you've got !!!