/* Flexible GPS Parser Display v3 David Johnson-Davies - www.technoblogy.com - 20th September 2017 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/ */ // Pins~ int const DI = 0; // USI USART int const data = 1; int const dc = 2; int const cs = 3; int const clk = 4; // OLED 64x48 monochrome display ********************************************** // Initialisation sequence for OLED module int const InitLen = 24; const unsigned char Init[InitLen] PROGMEM = { 0xAE, // Display off 0xD5, // Set display clock 0x80, // Recommended value 0xA8, // Set multiplex 0x3F, 0xD3, // Set display offset 0x00, 0x40, // Zero start line 0x8D, // Charge pump 0x14, 0x20, // Memory mode 0x00, // Horizontal addressing 0xA1, // 0xA0/0xA1 flip horizontally 0xC8, // 0xC0/0xC8 flip vertically 0xDA, // Set comp ins 0x12, 0x81, // Set contrast 0x7F, // 0x00 to 0xFF 0xD9, // Set pre charge 0xF1, 0xDB, // Set vcom detect 0x40, 0xA6, // Normal (0xA7=Inverse) 0xAF // Display on }; // Write a data byte to the display void Data(uint8_t d) { uint8_t changes = d ^ (d>>1); PORTB = PORTB & ~(1<>= 1) { PINB = 1<> 1) & 0x55) | ((x << 1) & 0xaa); x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); return x; } // Initialise USI for UART reception. void InitialiseUSI (void) { DDRB &= ~(1<