edit

# Getting Started with Infrared Emitter¶

This repo demonstrates how to use the built-in Infrared Emitter as component in Wio Terminal. The Infrared Emitter is a Digital Interface and can be used to send IR signal, just like what a remote control does!

## Installing the Infrared Library For Wio Terminal¶

2. Now, the Infrared library can be installed to the Arduino IDE. Open the Arduino IDE, and click sketch -> Include Library -> Add .ZIP Library, and choose the Seeed_Arduino_IR file that you've have just downloaded.
Note: WIO_IR is defined for the builtin Infrared Emitter(Already defined in the header file of this library so no need to defined in ino file)
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 /* send.ino Example sketch for IRLib2 * Illustrates how to send a code. */ #include // First include the send base //Now include only the protocols you wish to actually use. //The lowest numbered protocol should be first but remainder //can be any order. #include #include #include // After all protocols, include this // All of the above automatically creates a universal sending // class called "IRsend" containing only the protocols you want. // Now declare an instance of that sender. IRsend mySender; void setup() { Serial.begin(9600); delay(2000); while (!Serial); //delay for Leonardo Serial.println(F("Every time you press a key is a serial monitor we will send.")); } void loop() { if (Serial.read() != -1) { // send a code every time a character is received from the // serial port. You could modify this sketch to send when you // push a button connected to an digital input pin. // Substitute values and protocols in the following statement // for device you have available. // mySender.send(SONY,0xa8bca, 20);//Sony DVD power A8BCA, 20 bits mySender.send(NEC,0x61a0f00f,0);//NEC TV power button=0x61a0f00f Serial.println(F("Sent signal.")); } }