#include <Arduino.h>
#include <TinyWireM.h>
#include <Tiny4kOLED.h>
const uint8_t line7 [] PROGMEM = { B11110000 };
const uint8_t line6 [] PROGMEM = { B01111000 };
const uint8_t line5 [] PROGMEM = { B00111100 };
const uint8_t line4 [] PROGMEM = { B00001111 };
const uint8_t line3 [] PROGMEM = { B10000111 };
const uint8_t line2 [] PROGMEM = { B11000011 };
const uint8_t line1 [] PROGMEM = { B11100001 };
const unsigned char* line_anim_array[7] = {
line1,
line2,
line3,
line4,
line5,
line6,
line7
};
byte line_anim_frame = 0;
const unsigned char epd_bitmap_car_elec[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf8, 0xfc, 0xbe, 0xff, 0xcf, 0xcf, 0xff, 0xbe, 0xfc,
0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff,
0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x7f, 0x7f, 0xfc, 0xbc, 0x7c, 0x7c, 0xbc, 0xfc, 0x7f,
0x7f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
void drawRoadLines() {
for(int a = 1; a < 4; a++) {
for(int i = 0; i < 8; i++) {
oled.setCursor(i,a);
oled.bitmap(32*a, i, 32*a+1, i+1, line_anim_array[line_anim_frame]); // draw the animation part of the turbo gauge
}
}
line_anim_frame = (line_anim_frame + 1) % 7;
}
void setup() {
oled.begin();
}
void loop() {
delay(100);
drawRoadLines();
oled.setCursor(0,0);
oled.bitmap(0, 0, 24, 3, epd_bitmap_car_elec);
}