Complete noobie here. I'm trying to make my ATTiny85 decode IR signals from a TSOP1738 and control LED's with it. The whole thing's very easy using an Arduino but I can't get it to work on the ATTiny85.
Using the tinyIRRemote library (Also tried Ken Shirriff's IRRemote).
#include <tiny_IRremote.h>
#include <tiny_IRremoteInt.h>
int RECV_PIN = 0;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
irrecv.enableIRIn();
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
}
void loop()
{
if (irrecv.decode(&results))
{
irrecv.resume();
}
if(results.value != 0 && results.value!= 0xFFFFFFFF)
{
if (results.value == 0xFFA25D)
{
digitalWrite(4, HIGH);
results.value = 0;
}
if (results.value == 0xFF629D)
{
digitalWrite(3, HIGH);
results.value = 0;
}
if (results.value == 0xFFE21D)
{
results.value = 0;
}
if (results.value == 0xFF22DD)
{
digitalWrite(2, HIGH);
results.value = 0;
}
}
}
All it does is decode the IR signal based on the library, checks it with a set value, and turns a pin ON.
Nothing happens when I press the button. An LED connected to the signal of the TSOP1738 and ground flickers when I press the button. Everything else is fine too. I can find little help on Google.