I’m trying to execute a function in a running Python script when I change the position of a switch on my RC transmitter.
My PPM receiver is connected to Navio2 as normal on the servo rail. I’ve tried the ‘RCInput’ example, which shows the PWM signal value (for the specific channel) changing from 1000 to 2000 when I flick the switch; I therefore need to determine when this value changes in a script.
I believe there are two ways of doing this:
- Polling i.e. requesting the value at regular time intervals
- Using Interrupts
I would like to use interrupts ideally because of lower CPU usage. I know it’s possible to generate interrupts for a PWM signal on Arduino, and using the GPIO pins on the Pi (using Pigpio library), but I don’t know if it’s possible using the Navio2 PPM chip?
I would greatly appreciate any help; thanks.