PPM-reader icon indicating copy to clipboard operation
PPM-reader copied to clipboard

Use PPMReader with a RP2040 Zero

Open pierrotm777 opened this issue 1 year ago • 3 comments

Hello,

I try to use your library with a RP2040 Zero but the serial terminal return 0 for all channels. In theory the PI RP2040 accept interrups on all its pins.

My code is the demo and i use the pin 2: `/* This example outputs values from all PPM channels to Serial in a format compatible with Arduino IDE Serial Plotter */

#include <PPMReader.h>

// Initialize a PPMReader on digital pin 3 with 6 expected channels. byte interruptPin = 2; byte channelAmount = 8; PPMReader ppm(interruptPin, channelAmount);

void setup() { Serial.begin(115200); }

void loop() { // Print latest valid values from all channels for (byte channel = 1; channel <= channelAmount; ++channel) { unsigned value = ppm.latestValidChannelValue(channel, 0); Serial.print(value); if(channel < channelAmount) Serial.print('\t'); } Serial.println(); delay(20); }`

If i test on an Pro Micro, the code is running very well.

Thanks for your help.

pierrotm777 avatar Jun 03 '24 09:06 pierrotm777

Hey, I have given a reply for a similar problem on issue #6 . I don't have a RP2040 Zero, but maybe you could try my answer ? If you do, please give us a feedback so I could add it to my pull request (maybe this isn't a ESP32-issue-only ?).

grybouilli avatar Jul 12 '24 18:07 grybouilli

Sorry, not solve my issue :-(

pierrotm777 avatar Aug 14 '24 10:08 pierrotm777

Hello,

I try to use your library with a RP2040 Zero but the serial terminal return 0 for all channels. In theory the PI RP2040 accept interrups on all its pins.

My code is the demo and i use the pin 2: `/* This example outputs values from all PPM channels to Serial in a format compatible with Arduino IDE Serial Plotter */

#include <PPMReader.h>

// Initialize a PPMReader on digital pin 3 with 6 expected channels. byte interruptPin = 2; byte channelAmount = 8; PPMReader ppm(interruptPin, channelAmount);

void setup() { Serial.begin(115200); }

void loop() { // Print latest valid values from all channels for (byte channel = 1; channel <= channelAmount; ++channel) { unsigned value = ppm.latestValidChannelValue(channel, 0); Serial.print(value); if(channel < channelAmount) Serial.print('\t'); } Serial.println(); delay(20); }`

If i test on an Pro Micro, the code is running very well.

Thanks for your help.

I'm using the rp2040 reading ppm perfectly using this library (on pin 12) if it recieves a pulse shorter than 1000 or longer than 2000, it will return a 0 instead of the value, perhaps thats the issue?

RollPitchYall avatar Jun 13 '25 21:06 RollPitchYall