Hi! I use the next code on Atmega328 and I want to upload it on Attiny85. I use this tutorial: http://highlowtech.org/?p=1706. I can to upload code on Attiny85, but the LED (connected at pin 4) don’t react when I press the button of TV remote control. I mention that this program (with different pins) works at Atmega328. The button code (0x10EFCB34) is obtained with IRrecvDump and Atmega. It’s possible that Attiny have different code for this button? How to find it? I don’t know to use Dump on Attiny because I have this error: 'Serial' was not declared in this scope. I try to find button code in default case, but I have error. I can’t use serial monitor. Please help me with this two problems. Thanks!
#include "IRremote.h"
int receiver = 0;
IRrecv irrecv(receiver);
decode_results results;
void setup()
{
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
Serial.begin(9600);//without this I can upload on Attiny
irrecv.enableIRIn();
}
void loop()
{
if (irrecv.decode(&results))
{
translateIR();
irrecv.resume();
}
}
int var=LOW;
void translateIR()
{
switch(results.value)
{ case 0x10EFCB34:
var=!var;
digitalWrite(4,var);
break;
default: //this is for find button code, but don't works serial...
Serial.println(results.value);
break;
}
delay(50);
}