irremote not working properly on arduino boards

Abierto
#748 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
43/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
arduino, go
Área
embedded-iot

Línea de trabajo

Start by reading the irremote driver and its pulse timing and state transitions, then inspect TinyGo machine interrupt support for the Arduino Nano Every and Nano 33 IoT. Compare received pulse timings and state progression on both boards with the working Arduino IDE behavior described in the issue. Done when IR button presses produce consistent decoded command values on both boards.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

irremote library (or the underlying tinygo machine drivers) don't seem to be functioning properly for arduino boards. I tried on arduino nano every and arduino nano 33 iot and the behavior on both is different and not functioning properly in either. As a reference I compared against code written in Arduino IDE using IRremote.h and that worked in both cases.

Here are details:
The Arduino IDE code that worked on both boards:

#include <IRremote.h>

#define IR_RECEIVE_PIN 9

void setup() {
  Serial.begin(9600);
  IrReceiver.begin(IR_RECEIVE_PIN);
}

void loop() {
  if (IrReceiver.decode()) {
    IrReceiver.resume();
    Serial.println(IrReceiver.decodedIRData.command);
  }
}

It prints consistent values on the serial based on the button pressed on the IR remote.

The tinygo driver does not exhibit similar behavior. Looking more into the code it seems the pulse intervals are not arriving as expected. In particular, on arduino nano 33 iot board, the pulse timing appears to fall through following state changes as expected but fails to move to bitReadEnd due to a much longer than expected pulse.

State changes before reset occurs on arduino nano 33 iot

leadPulseStart
leadSpaceStart
leadSpaceEnd
bitReadStart

I should also mention that looking into pulse width timing the behavior is not consistent across different boards and I get different values on arduino nano every v/s arduino nano 33 iot.

Reading up other issues it seems SetInterrupt() is not implemented on all pins, however, that does not seems to be the issue here.

Lenguaje dominante
Go
Estrellas
756
Forks
251
Merge medio
7 d 12 h
PR fusionados (30 d)
8

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de tinygo-org/drivers

Todos los issues de tinygo-org/drivers

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.