Pine

🌲 An indoor infrared receiver and transmitter with a temperature sensor 🎐

power AA
wireless Infrared
mcu SAMD21G18
bom items 49
bom cost USD $9.71
vendors 2
completed September 2020

IR receive

infrared IR receive aircon medium

Receive and display raw IR code


Code

Download code
#include <IRLibRecvPCI.h>

IRrecvPCI myReceiver(5);  // Arduino ZERO pin 5

#define DEBUG 1

void setup() {
  #ifdef DEBUG
    SerialUSB.begin(9600);
    while (!SerialUSB) {}

    SerialUSB.println("Ready to receive IR signals");
    SerialUSB.println("Point the remote controller to the IR receiver and press!");
  #endif

  myReceiver.enableIRIn();
}

void loop() {
  if (myReceiver.getResults()) {
    #ifdef DEBUG
      if (recvGlobal.recvLength > 100) {
        SerialUSB.print("Received IR signal length: ");
        SerialUSB.println(recvGlobal.recvLength, DEC);
      }
    #endif

    myReceiver.enableIRIn();
  }
}

Makefile

BOARD?=arduino:samd:mzero_bl
PORT := $(shell ls /dev/cu.usbmodem*)

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright,-whitespace/line_length *.ino

all:
	arduino-cli compile --fqbn $(BOARD) ./

flash:
	arduino-cli upload -p $(PORT) --fqbn $(BOARD)

server:
	echo "Open Chrome browser at http://localhost:8000"
	python -m SimpleHTTPServer 8000

clean:
	rm -r build

References