Shop OBEX P1 Docs P2 Docs Learn Events
HELP!! RC Control of Boe Bot Pizzo Speaker — Parallax Forums

HELP!! RC Control of Boe Bot Pizzo Speaker

jonathanmbjonathanmb Posts: 24
edited 2013-02-14 17:56 in BASIC Stamp
I have a Boe Bot that is set up to be controlled by a 2.4ghz Spektrum model aircraft 6 channel radio system (RC).I have 4 servos the 2 navigation servos and 2 servos for panning and tilting a camera. I want to add a pizzo speaker to be controlled off of an extra channel on my radio. I have tried several times to work this into my program but could not. I am not very good at programming. The program is attached to this message. Any help would be much appreciated!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-14 09:10
    First of all, does your program work? Remember that when the Stamp is doing a PULSOUT (or anything else for that matter), it's not looking at the other I/O pins. If it's doing a PULSIN, the other input pins are being ignored. R/C servos depend on receiving a control pulse about every 20ms. Often they'll shutdown briefly and shudder if this pulse timing is missed. You may be just making it. 4 PULSOUTs worst case take about 9ms. 2 PULSINs and a little computation may take 6 to 8ms if you get the timing right. Adding another PULSIN may or may not work. If you want to use the kind of piezo (note spelling) speaker that has it's own oscillator in it (fixed tone), you could add it because you only have to turn the power to it on and off. If it's a plain piezo speaker, you won't be able to add it because the Stamp will have to generate the tone (with a FREQOUT statement) and, while it's making the tone, it can't do anything else (like move the wheels). You could add a tone generator chip (like a 555 timer) that the Stamp only needs to turn on and off.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-02-14 09:33
    You're about at the limit of what a BS2 can handle with all those inputs and servos.

    Just in case you interested, there is a Propeller Board of Education available now. It can do all the things you're after without breaking a sweat.

    Mike made a version of his FemtoBasic for the PropBOE. I'd think it would make the transition from BS2 to Prop a bit easier.

    I've used my PropBOE to control a BOE-Bot with a Specktrum radio. I included a feature that lets you record the path of the robot to play back later (which I think is kind of cool, if I do say so myself).

    Of course, there are plenty around here to help get the most out of the BS2 if you don't what to switch . . . yet. Did I mention the PropBOE has a lifetime warranty?

    P.S. Don't tell erco I mentioned the Prop in the BS2 forum. (If he only knew how many times I've successfully resisted the urge to do so. . ..)
  • jonathanmbjonathanmb Posts: 24
    edited 2013-02-14 10:35
    Thank you for your help! The program does work but the servos do jitter. Erco gave me a lot of help with that but there was just nothing we could do about it The peizo speaker is just a plain speaker, it does use freqout. I will look into the tone generator and see what I can do.
    Thanks
  • ercoerco Posts: 20,256
    edited 2013-02-14 17:56
    You could cheat, (ahem, workaround) in numerous ways. Simplest? Run a servo directly off your radio receiver and have that close a switch to a beeper circuit, 555 oscillator or such. Or have the stamp monitor that servo-controlled switch and generate a tone, if there'e enough overhead left. Or working the other way, the Stamp can occasionally measure the PULSIN of the receivers output, and close a relay which drives an oscillator.

    Many ways to get to Carnegie Hall, but the best is PRACTICE!
Sign In or Register to comment.