Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot program motion and flashing light — Parallax Forums

Boe-Bot program motion and flashing light

I have been trying to make my Boe-Bot move in just a forward direction for now and simultaneously have an LED flash while it is driving. I tried using a series of do loops but, they would just run the program sequentially instead of simultaneously. I have done research and I haven't gotten a solid answer. I am using the basic stamp BS2 module and the 2.5 version of the PBasic language on Basic stamp editor. Any help would be appreciated.

Comments

  • The BS2 can only do sequential program execution, 1 task at a time. You can use the time between servo refresh to blink an LED and possibly some other tasks, but it will be up to you to make sure the servo refresh pulses are not interrupted, that would cause the servos to slow down or stop.
    If you need concurrent programs executing at the same time then you may want to upgrade the board to a Propeller Activity Board and use the 8 parallel processors to do the magic.
  • ercoerco Posts: 20,256
    Try something like this (untested):

    do
    toggle 0 ' toggle LED on pin0
    for b0=1 to 50 'drive for a second
    pulsout 12, 650
    pulsout 13,850
    pause 20
    next
    loop
  • Thank you both this code did work on the Boe-bot I am using. :smile:
  • ercoerco Posts: 20,256
    Excellent, happy it worked for you. Welcome to the forums, keep on plugging away!
Sign In or Register to comment.