/* Tiny Time 2 Watch v2 - see http://www.technoblogy.com/show?1MG3 David Johnson-Davies - www.technoblogy.com - 30th May 2019 ATtiny85 @ 8 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 #include const int Tickspersec = 250; // Timer/Counter0 volatile uint8_t Timeout; volatile int Offset = 0; // For setting time volatile byte Cycle = 0; volatile int Hours = 0; // From 0 to 11, or 12 = off. volatile int Fivemins = 0; // From 0 to 11, or 12 = off. // Pin assignments int Pins[5][5] = {{ -1, 1, 3, -1, 5 }, { 2, -1, 10, -1, 0 }, { 9, 11, -1, -1, 7 }, { -1, -1, -1, -1, -1 }, { 4, 6, 8, -1, -1 } }; // Display multiplexer ********************************************** void DisplaySetup () { // Set up Timer/Counter0 to multiplex the display TCCR0A = 2< 250Hz } void DisplayOn () { TIMSK = 1<>OneWirePin & 1; } void DelayMicros (int micro) { TCNT1 = 0; TIFR = 1<>1) - 1; while ((TIFR & 1<> 1; } } uint8_t OneWireRead () { uint8_t data = 0; for (int i = 0; i<8; i++) { LowRelease(6, 9); data = data | PinRead()<