Hello All,
I'm trying to get an ATTiny85 to run a simple bit of code that will activate a 5V relay with a infrared remote button press and having trouble. It was trivial to get it working on an Arduino UNO using the standard IRremote library but cannot port it over to run on a 8Mhz Attiny85 using the tiny_IRremote library.I'm assuming I'm missing something or am doing something very wrong in code but am very inexperienced with Programming and after 3 solid days of troubleshooting and web searching. I'm now at a total loss.
The fuses of the ATTiny85 are set correctly to operate at 8Mhz. Confirmed with a simple digitalWrite "hello world" relay blink test which works just fine on the ATTiny. It's just not being responsive to any Infrared signals.
The IR receiver I'm using is a HS3008B with a demodulated output signal.
I'm using a Sony remote control to send the IR button presses that should correspond to those Hex Values in code.
I'm also using A Sparkfun USB Tiny AVR Programmer to upload code.
Like I said, this code works fine on my UNO with the standard IR library.
Any experienced help with getting IR working on my ATTiny85 would be greatly appreciated.
#include <tiny_IRremote.h>
#include <tiny_IRremoteInt.h>
int IRpin = 2;
int relay = 3;
IRrecv IR(IRpin);
decode_results results;
void setup() {
IR.enableIRIn();
pinMode(relay, OUTPUT);
}
void loop() {
while (IR.decode(&results) == 0) {
}
if (results.value == 0xCBB7E949) {
digitalWrite(relay, HIGH);
}
if (results.value == 0xE8455D8E) {
digitalWrite(relay, LOW);
}
delay(500);
IR.resume();
}