I tried to make one remote reciver board using Arduino and I could receive and recognize on of other keys first using in IRDemo then note in's converting em into hex and place it in the code just the way I wish
Connecting to pin 11 and 13 I made single chip Arduino with crystal regulator and pressing on or off just orders go to relay and so far so good
Hope the code I am posting is the right way below >>
Code: Select all
/*
* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
#include <IRremote.h>
#define Onn 2170986846
#define Offf 2170966446
int RECV_PIN = 11;
int relay = 13;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
pinMode(relay, OUTPUT);
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
//if (results.value == 2170986846)
if (results.value == 2170986846)
{
digitalWrite(relay, HIGH);
}
else if (results.value == 16744575)
{
digitalWrite(relay, HIGH);
}
//else if (results.value == 2170966446)
else if (results.value == 2170966446)
{
digitalWrite(relay, LOW);
}
else if (results.value == 16748655)
{
digitalWrite(relay, LOW);
}
irrecv.resume(); // Receive the next value
}
}
The thing I am new into Arduino programming and cant tune this code to make the single chip board even smaller to be inserted under wall switch or for saving time and crystal capacitors Etc. for the design
when I started Attiny85 board got lot of errors in compiling code as it all state Tinny chip is not capable of triggering 2 timers and memory isn't enough working back hard I could find a way to read the code from pin 0 using _VB the weak pint that I am not able to place the reading properly in something to segregate on off signals like above code if (results.value == 2170986846)
this type of code related to I searched for files called IRTinny.h but they wont compile or work for the small logic IC while running out of time for this project I need some advice into this direction
-Correct me if I am reading tinny signal with right command no external library or forward tested library
-explination of IR remote protocol for my poor programming skill and language so I can create so signals are read into bits and stops
-how to take those bits and place them into one word for comparison
I am using 1.0.5 IDE and uploaded Blink code to ATtiny85 using Arduino ISP getting some neglected error but code works just fine