thank you for your attention.
Arduino IDE showed error message like this
C:\Users\user\AppData\Local\Temp\arduino_build_364232/…\arduino_cache_580864\core\core_diy_
attiny_avr_attiny13_diy_version_attiny13,boot_none,clock_9_6MHz,core_MillisCore,millis_ppm_1p6,
print_BinHexDec,serial_HalfDuplexRW,lto_enable,bodlevel_2v7_6b7b3b2f0c5502ff24b3b6bf6d758fb0.a
: No such file or directory
I was doing programming sleep mode using pin change interrupt in attiny13 board
A kind of Power switch(Mosfet) activating in Certain (interrupt) signal
My sketch is as below
// ATiny_SmartSwitch.ino
//
#include <avr/io.h>
#include <avr/sleep.h>
const int wakeUpPin = 3; // PB3: External Signal Pin (Interrupt)
const byte powerPin = 4; // PB4: MOSFET Gate Pin
int prevState = 0;
int long time2sleep = 5000; // Stand by Time to Sleep (ms)
unsigned long lastActive = 0;
void setup() {
pinMode(wakeUpPin, INPUT);
digitalWrite(wakeUpPin, HIGH);
pinMode(powerPin,OUTPUT);
PCMSK |= (1<<PCINT3); // pin change mask: listen to portb, pin PB3
GIMSK |= (1<<PCIE); // enable PCINT interrupt // PB3 as an Interrupt Pin (Wake up)
}
void loop() {
digitalWrite (powerPin, HIGH); // MOSFET ON
if(digitalRead(wakeUpPin) == LOW) {
if(prevState == 0) lastActive = millis();
prevState = 1;
}
else {
prevState = 0;
}
if(millis()-lastActive > time2sleep) { // If 5 seconds passed since last wakeup occured, it goes to sleep
digitalWrite (powerPin, LOW);
goToSleep();
lastActive = millis();
}
}
void goToSleep() {
sleep_enable();
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_cpu(); // Sleep Now… z z z z z
sleep_disable(); // Wake up Here
}
ISR(PCINT0_vect) {
// Do Something !!!
}
I don’t understand what that error message means!
But I found out it worked in attiny 25/45/85 series, while I was struggling with this matter.
Main Differences between 13 and 25/45/85 are clock hz and Ram size
the address of this information is from the posting;
I think it could be a clue. but I dont know how to apply this clue to my sketch.
Can you advise me how to fix it?