/* Remote Decoding using Sure electronics Infrared Remote decoder module Serial # MB-SM1211 When a 38Khz signal is recieved by the module, it will then transmit the hexidecimal value (2 bytes: adress code then data code) that it recieves at 9600 baud. The value will then be converted to binary and printed to the serial monitor. The circuit: * Arduino Pin 0 (Rx) attached to Tx of decoder module * +5V from Arduino attached to +5V pin of decoder module * GND from Arduino attached to GND pin of decoder module March 11, 2011 by Solarbotics This example code is in the public domain. */ int incomingByte = 0; // for incoming serial data void setup(){ Serial.begin(9600); } void loop(){ if (Serial.available() > 0) { Serial.print("Remote code: "); while (Serial.available() > 0) { // read the incoming byte: incomingByte = Serial.read(); Serial.print(incomingByte, BIN); } Serial.println(); } }