I face below error cause by program space, I am surprise because my program just a few line. I am using ATTiny2313.
I cant understand where is the error ?
-----------------------------------Error --------------------------------------------
Arduino: 1.8.2 (Windows 8.1), Board: "ATtiny2313/4313, Disabled, ATtiny2313, 1 MHz (internal), B.O.D. Disabled, no"
E:\Arduino-MyProgram\interrupt\interrupt.ino: In function 'void setup()':
E:\Arduino-MyProgram\interrupt\interrupt.ino:12:24: warning: integer overflow in expression [-Woverflow]
t.pulse(ledPin, 1601000, HIGH);//1 min HIGH
^
Sketch uses 1500 bytes (73%) of program storage space. Maximum is 2048 bytes.
Global variables use 184 bytes (143%) of dynamic memory, leaving -56 bytes for local variables. Maximum is 128 bytes.
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
Error compiling for board ATtiny2313/4313.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I have a very short program, may i know why space not enough.
#include <Timer.h>
Timer t;
const byte ledPin = 0;
const byte interruptPin = 4;
volatile bool flag = false;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(interruptPin, INPUT);
attachInterrupt(digitalPinToInterrupt(interruptPin), setflag, FALLING);
t.pulse(ledPin, 1*60*1000, HIGH);//1 min HIGH
}
void loop() {
if (flag) {
t.update();
flag=false;
}
}
void setflag(){
flag = true;
}