/* Tiny Colour Watch - see http://www.technoblogy.com/show?1Y7J David Johnson-Davies - www.technoblogy.com - 15th January 2018 ATtiny85 @ 8 MHz (external crystal; BOD disabled) CC BY 4.0 Licensed under a Creative Commons Attribution 4.0 International license: http://creativecommons.org/licenses/by/4.0/ */ #include // Pin assignments const int Clk = 0; const int Data = 1; const int Enable = 2; // Constants const int Bright = 0; const int Blue = 1; const int Green = 2; const int Red = 3; const int Brightness = 15; // Brightness 1 to 31 // Colours of each 'hand' const int Second = Green; const int Minute = Red; const int Hour = Blue; const int Timeout = 15; // Blank display after 15 secs int Tickspersec = 125; // Ticks per second volatile uint8_t Ticks = 0; volatile unsigned long Seconds = 0; volatile int ShowDisplay; // Display buffer - sets the brightness and colour of the 12 RGB LEDs uint8_t Display[12][4]; // Software SPI ********************************************** void Write (uint8_t c) { int i=0x80; while (i) { if (c & i) PORTB = PORTB | 1<>1; PINB = 1<>level; } void DisplayOff () { DDRB = 1< 125Hz TIMSK = 1<