Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot Beginner Question on Code — Parallax Forums

Boe-Bot Beginner Question on Code

PorkinsPorkins Posts: 3
edited 2010-02-19 04:28 in Robotics
In the manual, page 56, it asks me to run this code:

Do
·· PULSOUT 13, 65000
·· PULSOUT 12, 65000
·· PAUSE 2000
Loop

Pin 12 and 13 each have a simple LED + Resistor circuit. The manual says to "verify that both LED circuits simultaneously pulse". But they are ALTERNATIVELY pulsing. One LED blinks, goes out,·then the next blinks, then a 2 second pause. Is this correct, or should they both be lighting at the SAME time? I know logically the programming has to complete the tasks in order before moving on, but the inconsistency in the manual and what I see is odd. How could I get both to light at the same time? I know we will be using this same format to drive the servos, so it kind of bothers me that one servo might start a fraction of a second before the other.

Thank you!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-19 04:28
    Sorry, the manual is not correct. As you've seen, the LEDs don't light simultaneously, just rapidly in succession as shown in the diagram on the same pages. For servos it's not the same issue because the pulses are shorter and the servos themselves maintain the position (or speed/direction) set by the pulse width and they can do that for about 20ms or so, long enough for a program to issue another pulse to the same servo.
Sign In or Register to comment.