Shop OBEX P1 Docs P2 Docs Learn Events
Newb needs help. Code routing power to servos instead of LED's! — Parallax Forums

Newb needs help. Code routing power to servos instead of LED's!

mills8102mills8102 Posts: 2
edited 2009-04-03 02:35 in Robotics
Hi, folks. I just picked up a Boe-Bot kit and am very excited about it. I have worked with qBasic before, so I have the rudiments of programming down ok, but as far as microcontrollers and breadboards, I am still in larvae phase.

I am following the instructions in chapter 2, activity 2 of the curriculum provided which involves lighting 2 LED's via the breadboard. I have read and re-read the instructions and followed them to the utmost of my abilities, but still when I run the program, it runs power to the servo outputs whose numbers correspond with the pin numbers of the resistor/LED circuits that I'm trying to get to work. Here is the program:

' {$STAMP BS2}
' {$PBASIC 2.5}

DEBUG "The LED to pin 13 is blinking."

DO
HIGH 13
PAUSE 500
LOW 13
PAUSE 500
LOOP

This is verbatim what is in the book. I don't think that it's a wiring problem because if it was, then nothing should happen when I run this code, right? Instead, my left servo is pulsing. I ran the resistors and LED's exactly as pictured in the book too and made sure that all components were seated properly and made good contact. The LED's are correctly oriented polarity-wise. Any advice would be much appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-02 13:34
    I believe the servo connectors on the board are wired to pins 13, 14, 15. The instructions assume that you're doing the exercises before you plug in the servos. Either unplug the servos or switch to different I/O pins.
  • mills8102mills8102 Posts: 2
    edited 2009-04-02 21:41
    Okay, thanks! I didn't realize that it routed power through the breadboard before going to the servos. I suspected this, and moved them to pins 14 and 15 but I must have got the wiring wrong, because I still got nothing. I'll try the original scheme with the servos disconnected, but one final question: even with the servos connected, shouldn't the LED's still light up, as they bridge the circuit on the same pin or does it not route power through the breadboard if it goes to the servos first? I'm going to pick up a multi-meter and check things out...
    Thanks again for the help.
  • GWJaxGWJax Posts: 267
    edited 2009-04-03 02:35
    You might have over seen this comment in the manual.. It reads as such : Always disconnect power to your board before building or modifying circuits! For the Board of Education Rev C, set the 3-position switch to position-0. For the BASIC Stamp HomeWork Board, disconnect the 9 V battery from the battery clip. Always double-check your circuit for errors before reconnecting power.

    Not changing your 3-position switch to position 0 is very common when starting off. Hope this helps

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
Sign In or Register to comment.