/* Low Power ATtiny85 David Johnson-Davies - www.technoblogy.com - 15th October 2019 ATtiny85 @ 1 MHz (internal oscillator; BOD disabled) CC BY 4.0 Licensed under a Creative Commons Attribution 4.0 International license: http://creativecommons.org/licenses/by/4.0/ */ #include // Arduino pins const int Speaker = 1; // PB1 piezo speaker pin const int Lamp = 2; // PB2 LED pin const int Button = 5; // Reset pushbutton const int Unused0 = 0; // PB0 const int Unused3 = 3; // PB3 const int Unused4 = 4; // PB4 // Constants const unsigned long Alarm = 900000; // alarm time - 15 minutes void playBeep(void) { tone(Speaker, 523, 250); delay(250); tone(Speaker, 659, 250); delay(250); tone(Speaker, 523, 500); delay(500); noTone(Speaker); } void flashLed (int wait) { digitalWrite(Lamp, HIGH); delay(wait); digitalWrite(Lamp, LOW); } // Main loop ********************************************** void setup() { pinMode(Lamp, OUTPUT); pinMode(Speaker, OUTPUT); // Don't leave unused pins floating pinMode(Unused0, INPUT_PULLUP); pinMode(Unused3, INPUT_PULLUP); pinMode(Unused4, INPUT_PULLUP); ADCSRA = ADCSRA & ~(1<