Hello, I am making a very simple project with a IR remote to control one equipment; one key switch on a pin (led) and another key switch off. I have tested this sketch in an arduino mini and its run perfectly. But because it is very simple i want to change it to an attiny85 but project do not fit:
After compiling:
In file included from /home/pedro/Arduino/ir2/ir2/ir2.ino:1:0:
/home/pedro/Arduino/libraries/IRremote/src/IRremote.hpp:281:2: warning: #warning INFO: No definition for LED_BUILTIN found -> default LED feedback is disabled. [-Wcpp]
#warning INFO: No definition for LED_BUILTIN found -> default LED feedback is disabled.
^~~~~~~
Sketch uses 7178 bytes (87%) of program storage space. Maximum is 8192 bytes.
Global variables use 546 bytes (106%) of dynamic memory, leaving -34 bytes for local variables. Maximum is 512 bytes.
Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint.
data section exceeds available space in board
Compilation error: data section exceeds available space in board
Compilation error: data section exceeds available space in board
I have seen some solutions on internet but I think those are a botch.
This is my code
#include <IRremote.hpp>
const int RECV_PIN = 3; // Pin de recepción del mando
const int led =4;
//unsigned int recibido;
byte recibido;
void setup()
{
pinMode(led, OUTPUT);
pinMode(RECV_PIN, INPUT_PULLUP);
IrReceiver.begin(RECV_PIN, DISABLE_LED_FEEDBACK); // Empezamos la recepción por IR
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
}
void loop()
{
if (IrReceiver.decode()) {
recibido=IrReceiver.decodedIRData.command;
IrReceiver.resume();
if (recibido==0x45){digitalWrite(led, LOW);}
if (recibido==0x46){digitalWrite(led, HIGH);}
delay (100);
}
You can see practically all memory is used by library.
¿How I can resolve this?
Many thanks.