mirror of
https://github.com/nopnop2002/esp-idf-ssd1306.git
synced 2024-10-03 18:18:47 -04:00
refactored
This commit is contained in:
parent
c8400de7b6
commit
a2857b8bd4
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
BIN
CarRaceDemo/image/highway_width2.jpg
Normal file
BIN
CarRaceDemo/image/highway_width2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
@ -43,4 +43,4 @@ convert highway_width.jpg _highway91.jpg -gravity northwest -geometry +79+0 -com
|
||||
convert highway_width.jpg _highway71.jpg -gravity northwest -geometry +83+0 -compose over -composite highway_width.jpg
|
||||
|
||||
# Split image in half
|
||||
convert highway_width.jpg -crop 128x64+0+0 highway0.jpg
|
||||
convert highway_width.jpg -crop 128x64+0+0 highway_width0.jpg
|
||||
|
@ -28,8 +28,8 @@
|
||||
|
||||
#define TAG "SSD1306"
|
||||
|
||||
uint8_t highway1[] = {
|
||||
// 'highway1', 128x64px
|
||||
uint8_t highway_width1[] = {
|
||||
// 'highway_width1', 128x64px
|
||||
0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff,
|
||||
0xff, 0x1c, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x38, 0xff,
|
||||
0xfe, 0x5c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x3a, 0x7f,
|
||||
@ -96,75 +96,74 @@ uint8_t highway1[] = {
|
||||
0xcf, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf9
|
||||
};
|
||||
|
||||
uint8_t highway0[] = {
|
||||
// 'highway0', 128x64px
|
||||
uint8_t highway_width2[] = {
|
||||
// 'highway_width2', 128x64px
|
||||
0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0x9c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x39, 0xff,
|
||||
0xff, 0x5c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x3a, 0xff,
|
||||
0xfe, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x7f,
|
||||
0xfd, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xbf,
|
||||
0xfb, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xdf,
|
||||
0xf7, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xef,
|
||||
0xef, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf7,
|
||||
0xdf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfb,
|
||||
0xbf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfd,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0xff,
|
||||
0xff, 0x5c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3a, 0xff,
|
||||
0xfe, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x7f,
|
||||
0xfd, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xbf,
|
||||
0xfb, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xdf,
|
||||
0xf7, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xe7,
|
||||
0xef, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0xdf, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf9,
|
||||
0xbf, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xfc,
|
||||
0xff, 0xdc, 0x00, 0x01, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x80, 0x3f, 0x80, 0x3b, 0xfe,
|
||||
0xff, 0xdc, 0x00, 0x01, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x80, 0x3f, 0x80, 0x3b, 0xff,
|
||||
0xff, 0x9c, 0x00, 0x01, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x80, 0x3f, 0x80, 0x39, 0xff,
|
||||
0xff, 0x5c, 0x00, 0x01, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x80, 0x3f, 0x80, 0x3a, 0xff,
|
||||
0xfe, 0xdc, 0x00, 0x01, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x80, 0x3f, 0x80, 0x3b, 0x7f,
|
||||
0xfd, 0xdc, 0x00, 0x01, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x80, 0x3f, 0x80, 0x3b, 0x9f,
|
||||
0xfb, 0xdc, 0x00, 0x01, 0xfc, 0x00, 0xfe, 0x00, 0x7f, 0x00, 0x3f, 0x80, 0x3f, 0x80, 0x3b, 0xdf,
|
||||
0xf7, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0x3b, 0xe7,
|
||||
0xef, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0xdf, 0xdc, 0x03, 0xfe, 0x01, 0xff, 0x00, 0xff, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x3b, 0xf9,
|
||||
0xbf, 0xdc, 0x03, 0xfe, 0x01, 0xff, 0x00, 0xff, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x3b, 0xfd,
|
||||
0xff, 0xdc, 0x03, 0xfe, 0x01, 0xff, 0x00, 0xff, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x3b, 0xfe,
|
||||
0xff, 0xdc, 0x03, 0xfe, 0x01, 0xff, 0x00, 0xff, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0x9c, 0x03, 0xfe, 0x01, 0xff, 0x00, 0xff, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x39, 0xff,
|
||||
0xff, 0x5c, 0x03, 0xfe, 0x01, 0xff, 0x00, 0xff, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x3a, 0xff,
|
||||
0xfe, 0xdc, 0x03, 0xfe, 0x01, 0xff, 0x00, 0xff, 0x80, 0x7f, 0xc0, 0x7f, 0xc0, 0x00, 0x3b, 0x7f,
|
||||
0xfd, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x9f,
|
||||
0xfb, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xdf,
|
||||
0xf7, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xe7,
|
||||
0xef, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf3,
|
||||
0xdf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf9,
|
||||
0xbf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfd,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfe,
|
||||
0xff, 0xdc, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x39, 0xff,
|
||||
0xff, 0x9c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3a, 0xff,
|
||||
0xff, 0x5c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x7f,
|
||||
0xfe, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x9f,
|
||||
0xfd, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xdf,
|
||||
0xfb, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xe7,
|
||||
0xf7, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0xef, 0xdc, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x3b, 0xf9,
|
||||
0xdf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfd,
|
||||
0xbf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfe,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xff,
|
||||
0xff, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7f,
|
||||
0xff, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x3f,
|
||||
0xfe, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x9f,
|
||||
0xfd, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xdf,
|
||||
0xfb, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xe7,
|
||||
0xf7, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0xef, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf9
|
||||
};
|
||||
|
||||
|
||||
uint8_t vehicle1[] = {
|
||||
// 'vehicle1', 24x48px
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
@ -256,6 +255,13 @@ void app_main(void)
|
||||
while(1) { vTaskDelay(1); }
|
||||
}
|
||||
|
||||
// Allocate memory for background frame
|
||||
uint8_t *buffer = (uint8_t *)malloc(1024*2);
|
||||
if (buffer == NULL) {
|
||||
ESP_LOGE(TAG, "malloc failed");
|
||||
while(1) { vTaskDelay(1); }
|
||||
}
|
||||
|
||||
// Allocate memory for vehicle frame
|
||||
uint8_t *vehicle = (uint8_t *)malloc(1024*3);
|
||||
if (vehicle == NULL) {
|
||||
@ -281,9 +287,21 @@ void app_main(void)
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, highway1, 128, 64, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, highway_width1, 128, 64, false);
|
||||
ssd1306_get_buffer(&dev, &buffer[1024*0]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, highway_width2, 128, 64, false);
|
||||
ssd1306_get_buffer(&dev, &buffer[1024*1]);
|
||||
vTaskDelay(10);
|
||||
|
||||
// Show initial background
|
||||
ssd1306_set_buffer(&dev, &buffer[1024*0]);
|
||||
ssd1306_show_buffer(&dev);
|
||||
vTaskDelay(10);
|
||||
|
||||
int frameIndex=1;
|
||||
int page = 0;
|
||||
int vehicleHorizontalPosition[3] = {20, 52, 84};
|
||||
int vehicleVerticalPosition[3] = {-8, 1, -14};
|
||||
@ -291,14 +309,27 @@ void app_main(void)
|
||||
while(1) {
|
||||
ssd1306_wrap_arround(&dev, PAGE_SCROLL_DOWN, 0, 0, -1);
|
||||
|
||||
#if WITH_VEHICLE
|
||||
// Get frame without vehicle
|
||||
ssd1306_get_buffer(&dev, save);
|
||||
|
||||
// Get from internal buffer to local buffer
|
||||
// buffer is [8][128] 8 page 128 pixel
|
||||
ssd1306_get_buffer(&dev, wk);
|
||||
|
||||
// Update buffer
|
||||
int frameOffset = frameIndex*1024;
|
||||
int dst_index = 0;
|
||||
int src_index = (7-page)*128+frameOffset;
|
||||
ESP_LOGD(TAG, "frameIndex=%d page=%d src_index=%d", frameIndex, page, src_index);
|
||||
for (int seg=0;seg<128;seg++) {
|
||||
wk[dst_index++] = buffer[src_index++];
|
||||
}
|
||||
|
||||
// Set frame without vehicle
|
||||
ssd1306_set_buffer(&dev, wk);
|
||||
|
||||
|
||||
#if WITH_VEHICLE
|
||||
// Get frame without vehicle
|
||||
ssd1306_get_buffer(&dev, save);
|
||||
|
||||
// Set vehicle image
|
||||
for (int vehicleFrame=0;vehicleFrame<3;vehicleFrame++) {
|
||||
int startPage = vehicleVerticalPosition[vehicleFrame];
|
||||
@ -337,6 +368,8 @@ void app_main(void)
|
||||
vehicleVerticalPosition[vehicleFrame] = -8;
|
||||
}
|
||||
}
|
||||
frameIndex++;
|
||||
if (frameIndex > 1) frameIndex=0;
|
||||
}
|
||||
} // end while
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user