Navio2 RCInput to Output Example

Can someone point me to a simple example that shows how to translate RCInput readings into PWM outputs that I can pass to an ESC. All I need is to see how RCInput values are translated into PWM values.

Edit:

So it looks like I need to configure my ESC at 400Hz. so pwm.setperiod(ch, 400)

At 400HZ this is a period of 2.5mS correct ? So pwm.set_duty_cycle( ch, ??? ).

What max/min should I use when calling set_duty_cycle in this case ?

thanks!
mark

I think I’ve got it figured out.

pwm.setperiod(ch, 400 )

then pwm.set_duty_cycle( ch, val )

val in the range of 1.1 to 1.8 seems to control the motors fine.

1 Like