PDA

View Full Version : LED problem: PulseBothLEDs.bs2



legoman35515
06-19-2010, 11:33 PM
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?

Franklin
06-20-2010, 03:28 AM
You probably typed your code incorrectly or you are expecting something the code is not designed to do. I can't tell because you didn't attach it to your post. PULSOUT will generate a pulse for the amount of time specified and then go to the next command. You may want to use HIGH and LOW instead.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

Sandhuamarinder
06-20-2010, 01:47 PM
No you will not able to see the normal LED flashing.
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.

hover1
06-21-2010, 04:20 AM
You can see a normal LED flash at .13 second duration just fine. Check your facts. I have run these demonstrations myself. Have·you?

What special LED would·you be referring to?

Please clean up your·text and grammar. It's·almost unreadable.

Jim


Sandhuamarinder said...
No you will not able to see the normal LED flashing.
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.

Post Edited (hover1) : 6/20/2010 11:44:40 PM GMT

hover1
06-21-2010, 04:32 AM
I think the "simultaneously" wording in the document is a little misleading.·What you should see is·the first·LED light for .13 seconds, and than the the second LED light for .13 seconds, then a 2 second pause, and the cycle repeats.

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



legoman35515 said...

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?

Brian B
06-21-2010, 01:21 PM
i did that project too and i had the same issue what i did it move the pulsout's into one line

EXAMPLE

DEBUG "Program Running"
DO
PULSOUT 13, 65000 PULSOUT 13, 65000
LOOP

EverQurious
07-03-2010, 05:39 PM
For this simple a program I would leave out the pulse commands and you should get the desired results with the code below.

'{$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 !!!