triggering bs2 to run with RC receiver
Archiver
Posts: 46,084
I plan on connecting the RC receiver to an Input line on the basic
stamp 2. From there I need to read in the voltage to see whether
the transmitter has generated a pulse. I know I need to use the
PULSEIN command and LOOKUP command.. I am not quite sure the values
I need to check for in order to branch. Any one familiar with RC
and PWM? I believe it is 0 to 255 duty cycles. Should I have it
continually check to see if the voltage is 1.5 or higher?
stamp 2. From there I need to read in the voltage to see whether
the transmitter has generated a pulse. I know I need to use the
PULSEIN command and LOOKUP command.. I am not quite sure the values
I need to check for in order to branch. Any one familiar with RC
and PWM? I believe it is 0 to 255 duty cycles. Should I have it
continually check to see if the voltage is 1.5 or higher?
Comments
between 1.0 and 2.0 every 20 ms or so, you can easily write a test
program to display the pulse values. Something like this:
Main:
PULSIN RCpin, 1, pWidth
IF (pWidth = 0) THEN Main
DEBUG HOME, DEC4 pWidth
GOTO Main
When you move the joystick that affects the channel connected to the
BASIC Stamp you should see changes in the Debug window. From there you
can then make decisions about how to construct your code.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Christina [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=jKgFp41RDeaG__b66MIUoElhKgIjWsMFDiheGQMLjATuyp3LMuqphWWu2rm63Z3yle38Zs308A]jobs@c...[/url
Sent: Tuesday, March 16, 2004 11:10 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] triggering bs2 to run with RC receiver
I plan on connecting the RC receiver to an Input line on the basic
stamp 2. From there I need to read in the voltage to see whether
the transmitter has generated a pulse. I know I need to use the
PULSEIN command and LOOKUP command.. I am not quite sure the values
I need to check for in order to branch. Any one familiar with RC
and PWM? I believe it is 0 to 255 duty cycles. Should I have it
continually check to see if the voltage is 1.5 or higher?
on that line should give you the width of the
next pulse. You MIGHT want to check the line is
'silent' first -- wait a little until the line
is LOW, so the next edge you see will be the
positive going part of the 1.0 to 2.0 mSec pulse.
SO, if your returned value is 500 (on the BS2)
this indicates 1.0 mSec (full left). If 750,
this indicates 1.5 mSec (Center value). If
1000, this indicates 2.0 mSec (full right).
--- In basicstamps@yahoogroups.com, "Christina" <jobs@c...> wrote:
> I plan on connecting the RC receiver to an Input line on the basic
> stamp 2. From there I need to read in the voltage to see whether
> the transmitter has generated a pulse. I know I need to use the
> PULSEIN command and LOOKUP command.. I am not quite sure the
values
> I need to check for in order to branch. Any one familiar with RC
> and PWM? I believe it is 0 to 255 duty cycles. Should I have it
> continually check to see if the voltage is 1.5 or higher?