I'm trying to add IR remote control to the WebradioMP3PlusWebUI example (running on a Pi Pico 2 W)
I modified the example with the following code:
void remotControlISR(){
digitalWrite(12, digitalRead(11));
}
essentially copying the interrupt triggering the input to an output pin
I modified the setup() as follows:
void setup() {
/*
original setup code from example
*/
...
web.on("/setvol", handleVolume);
web.on("/seturl", handleURL);
mp3.begin();
//New code added
pinMode(11, INPUT_PULLUP);
attachInterrupt(11, remotControlISR, CHANGE);
pinMode(12, OUTPUT);
}
When I send an IR code to the sensor, this is the capture from the scope:
The bottom half of the screen is a zoom in of the full code capture (top). The yellow trace is the input, and the blue trace is the output pin. For the most part, the interrupts trigger properly, with the blue trace closely following the yellow trace. but a bit to the right of the middle of th escreen, there are 3 short pulses at the input that get essentially missed by the ISR. I guess that this is because the interrupts either get disabled or the audio play interrupt has higher priority than the GPIO interrupt.
Is there any way around this?
Thanks!
I'm trying to add IR remote control to the WebradioMP3PlusWebUI example (running on a Pi Pico 2 W)
I modified the example with the following code:
essentially copying the interrupt triggering the input to an output pin
I modified the setup() as follows:
When I send an IR code to the sensor, this is the capture from the scope:
The bottom half of the screen is a zoom in of the full code capture (top). The yellow trace is the input, and the blue trace is the output pin. For the most part, the interrupts trigger properly, with the blue trace closely following the yellow trace. but a bit to the right of the middle of th escreen, there are 3 short pulses at the input that get essentially missed by the ISR. I guess that this is because the interrupts either get disabled or the audio play interrupt has higher priority than the GPIO interrupt.
Is there any way around this?
Thanks!