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

Emit raw infrared code

infrared IR emit raw medium

This code takes in a raw dump of IR and emits it using Arduino Zero with SAMD21G micro-controller on a crystalless custom PCB.


Code

Download code
#include <IRLibSendBase.h>
#include <IRLib_HashRaw.h>
#include "./data.h"

IRsendRaw mySender;
#define IR_EMIT_PIN 9

void setup() {
  SerialUSB.begin(9600);
}

void loop() {
  delay(5000);
  SerialUSB.println("Sending ON");
  mySender.send(rawDataON, RAW_DATA_LEN, 38);
  SerialUSB.println("Sent Turn ON Aircon");

  delay(5000);
  SerialUSB.println("Sending OFF");
  mySender.send(rawDataOFF, RAW_DATA_LEN, 38);
  SerialUSB.println("Sent Turn OFF Aircon");
}

Makefile

BOARD?= arduino:samd:arduino_zero_native
PORT?=/dev/cu.usbmodem14*

.PHONY: default lint all flash clean

default: lint all flash clean

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

all:
	# This custom PCB does not have a crytal on pins PA00 and PA01
	# Hence, use -DCRYSTALLESS to replace the extra_flags in boards.txt
	arduino-cli compile --fqbn $(BOARD) --build-properties build.extra_flags="-DCRYSTALLESS -D__SAMD21G18A__ {build.usb_flags}" ./ --verbose

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

clean:
	rm -r build

References