Reading and sending PWM signal
WILLQH
Posts: 11
Hi,
···Is the parallax microprocessor able to read in PWM signal from a receiver and subseqently·pass this same signal to a pair of servos·? If yes, can someone·please show me a sample code ? Thanks alot !!
Best regards
·
···Is the parallax microprocessor able to read in PWM signal from a receiver and subseqently·pass this same signal to a pair of servos·? If yes, can someone·please show me a sample code ? Thanks alot !!
Best regards
·
Comments
I presume you're speaking of the output of a standard R/C transmitter, transmitted to a standard R/C receiver which isn't really PWM, although the pulse width's do vary. If so here's what you do:
duration VAR WORD
PinPort1 CON 0 'set to one of the pin port numbers
PinPort2 CON 1 'set to one of the pin port numbers
PULSIN PinPort1, 1, duration
PULSOUT PinPort2, duration
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
· What i am trying to do here with my Airplane is to allow the pilot to have control of the servo using the remote controller (Say for example through channel 1)·but when he decide to·pass on·the control command to the·parallax microprocessor, he will then turn on a separate·channel·(say for example channel 3·) and the control·logic of the servo·will then·come directly from·the program·downloaded in the microporocessor. So basically,·both input from channel 1 and 3 will be fed into the microprocessor .. but when channel 3 is·off, the microprocessor should simply read in the signal from the remote controller (channel 1)·and pass on this·same signal to the servo. On the other hand, if channel 3·is on. the·microprocessor will ignore the·signal (if any) coming from channel 1 and·carry out the control logic·pre downloaded in the microprocessor. This is sort of like an autopilot mode, which the pilot is allowed to select, so that he dont have to control the servo.
Are you able to show me a sample code·on how to·carry out such a function? Thank you so much for your help and advice.
Best regards
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
· Nope .. i am not working on a autopilot .. Just using the parallax microprocessor to control the servo·when the pilot decide to·hand over·the control of the servo to the inbuilt program . Thank you.
Regards
·