Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //************************************************************************
- // Name : Rc5Decoder *
- // Author : Tarilayefa Edward *
- // Notice : Copyright (c) 2017 *
- // : Tari Electronics & Embedded Systems (TEES) *
- // : tarielectronics@yahoo.com *
- // : tariembeddedsys@gmail.com *
- // Date : 25/07/2017 *
- // Version : 1.0 *
- // Notes : An rc5 ir remote control decoder program to decode *
- // : philips infra-red remote controls and display button *
- // : address and commands on serial terminal. *
- // Compiler : Arduino 1.8.1 *
- // Target : Atmega 328, Arduino Uno, Nano etc. *
- //************************************************************************
- # include <RC5.h> //include rc5 library
- int IR_PIN = A3; //ir remote sensor pin
- unsigned long t0;
- RC5 rc5(IR_PIN);
- void setup() {
- Serial.begin(9600);
- Serial.println("Starting");
- }
- void loop() {
- unsigned char toggle;
- unsigned char address;
- unsigned char command;
- if (rc5.read(&toggle, &address, &command))
- {
- Serial.print("address:");
- Serial.print(address);
- Serial.print(" command:");
- Serial.print(command);
- Serial.print(" toggle:");
- Serial.println(toggle);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement