walk/chew gum....simultaniously
· I am looking for a code that will allow me to program my Boe-bot to drive foward and flash·LED's·simultaniously. The problem is that either the servos will operate, or the LED's will operate. The other senario is that the LED's will run the same PULSOUT or HIGH/LOW command that the servos are using, so the flash sequence remains the same as servo duration.
·
·The Stamp wants to·handle commands only on an On-Off basis·for each of the I/O pins. Is there a way to isolate data packets that can be ignored by the rest of the program, thereby allowing me to run the LED's in any sequence that I wish despite·specific·commands to the servos?·
·· AJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PSALM 23
Post Edited (Husky X3) : 11/21/2007 5:23:43 PM GMT
·
·The Stamp wants to·handle commands only on an On-Off basis·for each of the I/O pins. Is there a way to isolate data packets that can be ignored by the rest of the program, thereby allowing me to run the LED's in any sequence that I wish despite·specific·commands to the servos?·
·· AJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PSALM 23
Post Edited (Husky X3) : 11/21/2007 5:23:43 PM GMT
Comments
This might give you an idea of how to tackle it:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
· AJ
P.S.
that is some code, Zoot, thanks. I will give it a shot.
i APPRECIATE EVERYONE'S HELP AND COMMENTS! thank you all.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PSALM 23
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
'Output Pins
LEDPIN1 PIN ??
LEDPIN2 PIN ???
DO
Hight LEDPIN1
Low LEDPIN2
FOR idx = 1 to 50
GOSUB YourCodeToControlServo
NEXT
LOW LEDPIN1
High LEDPIN2
FOR idx = 1 to 50
GOSUB YourCodeToControlServo
NEXT
LOOP
YourCodeToControlServo:
Your code goes here as a sub.
RETURN
Change the value(s) of idx to suit your needs.
You might also want to try RANDOM and OUTS in place of the High and Low.
I hope this helps.
SJW
What we're saying is that you have to interleave the servo handling and the LED handling rather than do one, than the other. It is certainly clearer and more straightforward to use something like a ServoPAL, but the Stamps can handle servos and LEDs at the same time with the interleaving.