Shop OBEX P1 Docs P2 Docs Learn Events
Reading and sending PWM signal — Parallax Forums

Reading and sending PWM signal

WILLQHWILLQH Posts: 11
edited 2006-01-23 06:58 in Learn with BlocklyProp
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

·

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-01-11 11:09
    WILLQH -

    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-11 16:14
    One of our Techs (Dave A) has a BOE-Bot here that is controlled by a standard RC Plane Radio System.· It even handles mixing of the channels.· I will send him this link to post his code for you.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • dandreaedandreae Posts: 1,375
    edited 2006-01-11 16:36
    I have a sample code for you to use with a BASIC Stamp 2 and a RC receiver that works very well with proprotional control.· Let me know if you have any more questions.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com
  • WILLQHWILLQH Posts: 11
    edited 2006-01-18 03:33
    Hi Dave,

    · 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
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2006-01-22 04:16
    Are you working on an autopilot?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • WILLQHWILLQH Posts: 11
    edited 2006-01-23 06:58
    Hi there,
    · 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
    ·
Sign In or Register to comment.