cyborg5 / IRLib2

Library for receiving, decoding, and sending infrared signals using Arduino
GNU General Public License v3.0
384 stars 138 forks source link

SAMD21 Compatibility with Serial.print #28

Open ckaraviotis opened 7 years ago

ckaraviotis commented 7 years ago

IRLibDecodeBase uses Serial.print statements throughout to log information to the console.

In the SAMD21 M0 board, the method for printing to the USB console is exposed via SerialUSB.print.

As a result of this, when I tested any of the decode examples (using decoder.dumpResults) the arduino became unresponsive.

I found a quick fix by adding #define Serial SERIAL_PORT_USBVIRTUAL to the IRLibDecodeBase.cpp file, which makes all the print statements work OK.

This might need to be added to other files wrapped in an #if

cyborg5 commented 7 years ago

What do you mean specifically by "SAMD21 M0 board". We have tested the code on Arduino Zero, Arduino M0 Pro, Adafruit Feather M0 Basic, Adafruit Feather M0 BLE, Adafruit Feather M0 Express, Adafruit Circuit Playground Express all based on the SAMD21 processor and none of them needed the modification that you suggested. By the way these were all using the latest Arduino.cc IDE. What were you using to compile?

ckaraviotis commented 7 years ago

This was using the Arduino M0 (not pro), with the latest version of the Arduino IDE, 1.8.2.