/* Flashing Thermometer David Johnson-Davies - www.technoblogy.com - 30th January 2016 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 const int red = 0; // PB0 const int green = 2; // PB2 // Read temperature ********************************************** int ReadADC() { ADCSRA = ADCSRA | 1<>i & 1; if (show || b || (i==0)) { if (value>>i & 1) colour = red; else colour = green; digitalWrite(colour, HIGH); WDDelay(0); // 12msec flash digitalWrite(colour, LOW); WDDelay(6); // 1 second gap show = true; } i--; } while (i>=0); } // Watchdog timer ********************************************** // Use Watchdog for time delay; n=0 is 16ms; n=6 is 1sec ; n=9 is 8secs, void WDDelay(int n) { set_sleep_mode(SLEEP_MODE_PWR_DOWN); WDTCR = 1<