INPUT two or more PWM signals from a R/C radio receiver to control PICAXE 28X2?

SolidWorksMagi

Senior Member
Hi,

I have one PWM_IN working on one receiver channel to control one PWM output, but I want to add a second PWM_INput from another receiver channel to control another PWM output pin on the 28X2 module. Two PWM Inputs at the same time controller different output pins on the 28X2 module.

What do I need to do to add a second PWM_IN?

symbol PWM_IN = C.1

init: servopos Srvo0, 150

; Main Body
do
pulsin PWM_IN,1,PulseIN

; IF conditions to control B.0 PWM gosub movements

IF PulseIN>275 and PulseIN<350 then gosub STOPP
loop

; Subroutines

STOPP:
servopos Srvo0, 150
return

end
 
Last edited:

stan74

Senior Member
You could repeat what works with another pin for in and out.Do one then the other.What you want is unclear.
 

SolidWorksMagi

Senior Member
Hi,

I need to use two PWM INPUTS at the same time: PWM_IN for Left/Right and the second PWM_IN for Up/Down ... I can't use the same PWM_IN for both inputs ...
 
Last edited:

abenn

Senior Member
As stan74 says, you could add another line for another pulsin:

Code:
symbol PWM_IN = C.1
symbol PWM_IN2 = C.2

init: servopos Srvo0, 150

; Main Body
do
pulsin PWM_IN,1,PulseIN
pulsin PWM_IN2,1,PulseIN2
. . . .
and then take whatever actions you need with PulseIN and PulseIN2 values.
 

SolidWorksMagi

Senior Member
Hi,

Thanks! I thought of adding a number, but didn't try it. Now I see that it works. I couldn't find it in the docs anywhere. Now maybe I can complete my OmniRover1 project.

Thanks again!
 
Top