added CarRaceDemo
8
CarRaceDemo/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# The following lines of boilerplate have to be in your project's CMakeLists
|
||||
# in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS ../components/ssd1306)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(ssd1306)
|
20
CarRaceDemo/README.md
Normal file
@ -0,0 +1,20 @@
|
||||
# CarRaceDemo for SSD1306
|
||||
|
||||
![CarRaceDemo](https://github.com/user-attachments/assets/ba48d335-7ea5-45d8-983d-322c145d856b)
|
||||
|
||||
I found this public image on the internet.
|
||||
So I played around with it a bit.
|
||||
This is a demo that's just for fun and doesn't help anyone.
|
||||
|
||||
![_365470](https://github.com/user-attachments/assets/897ab40a-f152-4b24-bc0f-43f8b7002291)
|
||||
|
||||
__Wire cables should be as short as possible.__
|
||||
I used a 10 cm wire cable.
|
||||
However, it is sometimes affected by noise.
|
||||
|
||||
__This demo does not support 128x32 panels.__
|
||||
|
||||
The SPI interface operates faster than the I2C interface.
|
||||
For SPI interfaces, there has a latency period between frames.
|
||||
By making this smaller, you can display it even faster.
|
||||
|
BIN
CarRaceDemo/image/365470.jpg
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
CarRaceDemo/image/_365470.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
CarRaceDemo/image/_highway1.jpg
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
CarRaceDemo/image/_highway5.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
CarRaceDemo/image/_highway6.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
CarRaceDemo/image/_highway7.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
CarRaceDemo/image/_highway71.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
CarRaceDemo/image/_highway8.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
CarRaceDemo/image/_highway9.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
CarRaceDemo/image/_highway91.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
CarRaceDemo/image/highway0.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
CarRaceDemo/image/highway1.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
CarRaceDemo/image/highway_width.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
CarRaceDemo/image/istockphoto-1282378168-1024x1024.jpg
Normal file
After Width: | Height: | Size: 86 KiB |
46
CarRaceDemo/image/mkimage.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
convert istockphoto-1282378168-1024x1024.jpg -crop 256x512+740+40 vehicle1.jpg
|
||||
convert vehicle1.jpg -resize 24x vehicle1.jpg
|
||||
convert istockphoto-1282378168-1024x1024.jpg -crop 256x512+30+32 vehicle2.jpg
|
||||
convert vehicle2.jpg -resize 24x vehicle2.jpg
|
||||
convert istockphoto-1282378168-1024x1024.jpg -crop 256x512+138+512 vehicle3.jpg
|
||||
convert vehicle3.jpg -resize 24x vehicle3.jpg
|
||||
|
||||
convert 365470.jpg -resize 128x _365470.jpg
|
||||
|
||||
# Crop image
|
||||
convert 365470.jpg -crop 382x382+106+125 _highway1.jpg
|
||||
|
||||
convert _highway1.jpg -resize 128x _highway1.jpg
|
||||
|
||||
|
||||
convert _highway1.jpg -fill "#FFFFFF" -draw "rectangle 0, 0, 43, 127" _highway5.jpg
|
||||
|
||||
convert _highway5.jpg -fill "#FFFFFF" -draw "rectangle 85 0, 127, 127" _highway5.jpg
|
||||
|
||||
|
||||
convert _highway5.jpg -fill "#FFFFFF" -draw "rectangle 79, 0, 127, 127" _highway6.jpg
|
||||
|
||||
convert _highway5.jpg -fill "#FFFFFF" -draw "rectangle 0, 0, 49, 127" _highway7.jpg
|
||||
convert _highway7.jpg -roll -50+0 _highway71.jpg
|
||||
|
||||
convert _highway5.jpg -fill "#FFFFFF" -draw "rectangle 0, 0, 61, 127" _highway8.jpg
|
||||
|
||||
convert _highway8.jpg -fill "#FFFFFF" -draw "rectangle 79, 0, 127, 127" _highway9.jpg
|
||||
convert _highway9.jpg -roll -62+0 _highway91.jpg
|
||||
|
||||
|
||||
|
||||
convert _highway6.jpg -roll -34+0 highway_width.jpg
|
||||
|
||||
convert highway_width.jpg _highway91.jpg -gravity northwest -geometry +45+0 -compose over -composite highway_width.jpg
|
||||
|
||||
convert highway_width.jpg _highway91.jpg -gravity northwest -geometry +62+0 -compose over -composite highway_width.jpg
|
||||
|
||||
convert highway_width.jpg _highway91.jpg -gravity northwest -geometry +79+0 -compose over -composite highway_width.jpg
|
||||
|
||||
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
|
BIN
CarRaceDemo/image/vehicle1.jpg
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
CarRaceDemo/image/vehicle2.jpg
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
CarRaceDemo/image/vehicle3.jpg
Normal file
After Width: | Height: | Size: 2.5 KiB |
4
CarRaceDemo/main/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
set(COMPONENT_SRCS "main.c")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS "")
|
||||
|
||||
register_component()
|
8
CarRaceDemo/main/component.mk
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# Main component makefile.
|
||||
#
|
||||
# This Makefile can be left empty. By default, it will take the sources in the
|
||||
# src/ directory, compile them and link them into lib(subdirectory_name).a
|
||||
# in the build directory. This behaviour is entirely configurable,
|
||||
# please read the ESP-IDF documents if you need to do this.
|
||||
#
|
348
CarRaceDemo/main/main.c
Normal file
@ -0,0 +1,348 @@
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_random.h"
|
||||
|
||||
#include "ssd1306.h"
|
||||
//#include "font8x8_basic.h"
|
||||
|
||||
/*
|
||||
You have to set this config value with menuconfig
|
||||
CONFIG_INTERFACE
|
||||
|
||||
for i2c
|
||||
CONFIG_MODEL
|
||||
CONFIG_SDA_GPIO
|
||||
CONFIG_SCL_GPIO
|
||||
CONFIG_RESET_GPIO
|
||||
|
||||
for SPI
|
||||
CONFIG_CS_GPIO
|
||||
CONFIG_DC_GPIO
|
||||
CONFIG_RESET_GPIO
|
||||
*/
|
||||
|
||||
#define TAG "SSD1306"
|
||||
|
||||
uint8_t highway1[] = {
|
||||
// 'highway1', 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,
|
||||
0xfc, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x3f,
|
||||
0xf9, 0xdc, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0xc0, 0x00, 0x3b, 0x9f,
|
||||
0xf3, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xcf,
|
||||
0xe7, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xe7,
|
||||
0xcf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf3,
|
||||
0x9f, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf9,
|
||||
0x3f, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfc,
|
||||
0x7f, 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, 0x3b, 0xff,
|
||||
0xff, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xff,
|
||||
0xfe, 0x5c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3a, 0x7f,
|
||||
0xfc, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x3f,
|
||||
0xf9, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x9f,
|
||||
0xf3, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xcf,
|
||||
0xe7, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xe7,
|
||||
0xcf, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0x9f, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf9,
|
||||
0x3f, 0xdc, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x3b, 0xfc,
|
||||
0x7f, 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, 0x3b, 0xff,
|
||||
0xff, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xff,
|
||||
0xfe, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7f,
|
||||
0xfc, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x3f,
|
||||
0xf9, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x9f,
|
||||
0xf3, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xcf,
|
||||
0xe7, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xe7,
|
||||
0xcf, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0x9f, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf9,
|
||||
0x3f, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xfc,
|
||||
0x7f, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xfe,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xff,
|
||||
0xff, 0x1c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x38, 0xff,
|
||||
0xfe, 0x5c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3a, 0x7f,
|
||||
0xfc, 0xdc, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x3b, 0x3f,
|
||||
0xf9, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x9f,
|
||||
0xf3, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xcf,
|
||||
0xe7, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xe7,
|
||||
0xcf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf3,
|
||||
0x9f, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf9,
|
||||
0x3f, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfc,
|
||||
0x7f, 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, 0x3b, 0xff,
|
||||
0xff, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x38, 0xff,
|
||||
0xff, 0x1c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3a, 0x7f,
|
||||
0xfe, 0x5c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x3f,
|
||||
0xfc, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0x9f,
|
||||
0xf9, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xcf,
|
||||
0xf3, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xe7,
|
||||
0xe7, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0xcf, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xf9,
|
||||
0x9f, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfc,
|
||||
0x3f, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0xfe,
|
||||
0x7f, 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, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7f,
|
||||
0xfe, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x3f,
|
||||
0xfc, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x9f,
|
||||
0xf9, 0xdc, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x40, 0x00, 0x3b, 0xcf,
|
||||
0xf3, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xe7,
|
||||
0xe7, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf3,
|
||||
0xcf, 0xdc, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x3b, 0xf9
|
||||
};
|
||||
|
||||
uint8_t highway0[] = {
|
||||
// 'highway0', 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, 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, 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
|
||||
};
|
||||
|
||||
|
||||
uint8_t vehicle1[] = {
|
||||
// 'vehicle1', 24x48px
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x83, 0xff, 0xfc, 0x7c, 0xff, 0xf1, 0xff, 0x3f, 0xf3, 0xff, 0x9f, 0xef, 0xff, 0xdf, 0xef, 0xff,
|
||||
0xef, 0xef, 0xff, 0xef, 0xef, 0xff, 0xef, 0xef, 0xff, 0xef, 0xef, 0xff, 0xef, 0xef, 0xff, 0xef,
|
||||
0xee, 0x00, 0xff, 0xe8, 0x00, 0x6f, 0xe8, 0x00, 0x2f, 0xe8, 0x00, 0x6f, 0xc8, 0x00, 0x47, 0xe0,
|
||||
0x00, 0x4f, 0xe4, 0x00, 0x5f, 0xe7, 0xc7, 0x8f, 0xe0, 0x00, 0x2f, 0xe1, 0xc7, 0x2f, 0xe3, 0xc7,
|
||||
0x0f, 0xe3, 0xc7, 0x2f, 0xe1, 0xc7, 0x2f, 0xe3, 0xc7, 0x2f, 0xe3, 0xc7, 0x0f, 0xe1, 0xc7, 0x2f,
|
||||
0xe8, 0x00, 0x6f, 0xef, 0x83, 0xef, 0xe9, 0xfe, 0x2f, 0xec, 0x00, 0x6f, 0xef, 0x83, 0xef, 0xef,
|
||||
0xff, 0xff, 0xef, 0xff, 0xef, 0xef, 0xff, 0xdf, 0xef, 0xff, 0xdf, 0xf7, 0xff, 0xdf, 0xf3, 0xff,
|
||||
0xbf, 0xfc, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
uint8_t vehicle2[] = {
|
||||
// 'vehicle2', 24x48px
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x7f, 0xfc,
|
||||
0xff, 0x9f, 0xfb, 0xff, 0xef, 0xfb, 0xff, 0xef, 0xfb, 0xff, 0xff, 0xf7, 0xff, 0xf7, 0xf7, 0xff,
|
||||
0xf7, 0xf7, 0xff, 0xf7, 0xf7, 0xff, 0xf7, 0xf7, 0xff, 0xf7, 0xf7, 0xff, 0xf7, 0xf7, 0x00, 0x77,
|
||||
0xf4, 0x00, 0x17, 0xf4, 0x00, 0x17, 0xe2, 0x00, 0x23, 0xf0, 0x00, 0x07, 0xf1, 0xff, 0xc7, 0xf5,
|
||||
0xff, 0xc7, 0xf1, 0xff, 0xc7, 0xf1, 0xff, 0xd7, 0xf5, 0xff, 0xd7, 0xf1, 0xff, 0xd7, 0xf1, 0xff,
|
||||
0xd7, 0xf5, 0xff, 0xd7, 0xf1, 0xff, 0xd7, 0xf1, 0xff, 0xd7, 0xf1, 0xff, 0xd7, 0xf5, 0xff, 0xd7,
|
||||
0xf5, 0xff, 0xd7, 0xf5, 0x00, 0x47, 0xf6, 0x00, 0x37, 0xf6, 0x00, 0x37, 0xf6, 0x00, 0x37, 0xf6,
|
||||
0x00, 0x37, 0xff, 0x00, 0x77, 0xfb, 0xff, 0xef, 0xfb, 0xff, 0xef, 0xfb, 0xff, 0xef, 0xfb, 0xff,
|
||||
0xef, 0xfc, 0x7f, 0x1f, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
uint8_t vehicle3[] = {
|
||||
// 'vehicle3', 24x48px
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x7f, 0xfe, 0x3f, 0x3f, 0xf8,
|
||||
0xff, 0xcf, 0xfb, 0xff, 0xe7, 0xf7, 0xff, 0xf7, 0xf7, 0xff, 0xf3, 0xe7, 0xff, 0xf3, 0xe7, 0xff,
|
||||
0xfb, 0xe7, 0xff, 0xfb, 0xe7, 0xff, 0xfb, 0xe6, 0x00, 0x3b, 0xe4, 0x00, 0x0b, 0xe0, 0x00, 0x0b,
|
||||
0xe4, 0x00, 0x0b, 0xe0, 0x00, 0x01, 0xc0, 0x00, 0x01, 0xc0, 0x00, 0x01, 0xe0, 0x00, 0x03, 0xe1,
|
||||
0xff, 0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff,
|
||||
0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xc3,
|
||||
0xe1, 0xff, 0xc3, 0xe1, 0xff, 0xcb, 0xe1, 0xff, 0xcb, 0xed, 0xff, 0xfb, 0xe6, 0x00, 0x3b, 0xe6,
|
||||
0x00, 0x1b, 0xe4, 0x00, 0x1b, 0xe4, 0x00, 0x13, 0xf4, 0x00, 0x13, 0xf3, 0xc1, 0xf7, 0xf8, 0x3f,
|
||||
0x0f, 0xfe, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
#define WITH_VEHICLE 1
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
SSD1306_t dev;
|
||||
|
||||
#if CONFIG_I2C_INTERFACE
|
||||
ESP_LOGI(TAG, "INTERFACE is i2c");
|
||||
ESP_LOGI(TAG, "CONFIG_SDA_GPIO=%d",CONFIG_SDA_GPIO);
|
||||
ESP_LOGI(TAG, "CONFIG_SCL_GPIO=%d",CONFIG_SCL_GPIO);
|
||||
ESP_LOGI(TAG, "CONFIG_RESET_GPIO=%d",CONFIG_RESET_GPIO);
|
||||
i2c_master_init(&dev, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);
|
||||
#endif // CONFIG_I2C_INTERFACE
|
||||
|
||||
#if CONFIG_SPI_INTERFACE
|
||||
ESP_LOGI(TAG, "INTERFACE is SPI");
|
||||
ESP_LOGI(TAG, "CONFIG_MOSI_GPIO=%d",CONFIG_MOSI_GPIO);
|
||||
ESP_LOGI(TAG, "CONFIG_SCLK_GPIO=%d",CONFIG_SCLK_GPIO);
|
||||
ESP_LOGI(TAG, "CONFIG_CS_GPIO=%d",CONFIG_CS_GPIO);
|
||||
ESP_LOGI(TAG, "CONFIG_DC_GPIO=%d",CONFIG_DC_GPIO);
|
||||
ESP_LOGI(TAG, "CONFIG_RESET_GPIO=%d",CONFIG_RESET_GPIO);
|
||||
spi_master_init(&dev, CONFIG_MOSI_GPIO, CONFIG_SCLK_GPIO, CONFIG_CS_GPIO, CONFIG_DC_GPIO, CONFIG_RESET_GPIO);
|
||||
#endif // CONFIG_SPI_INTERFACE
|
||||
|
||||
#if CONFIG_FLIP
|
||||
dev._flip = true;
|
||||
ESP_LOGW(TAG, "Flip upside down");
|
||||
#endif
|
||||
|
||||
#if CONFIG_SSD1306_128x64
|
||||
ESP_LOGI(TAG, "Panel is 128x64");
|
||||
ssd1306_init(&dev, 128, 64);
|
||||
#endif // CONFIG_SSD1306_128x64
|
||||
#if CONFIG_SSD1306_128x32
|
||||
ESP_LOGE(TAG, "Panel is 128x32. This demo cannot be run.");
|
||||
while(1) { vTaskDelay(1); }
|
||||
#endif // CONFIG_SSD1306_128x32
|
||||
|
||||
// Allocate memory for work frame
|
||||
uint8_t *wk = (uint8_t *)malloc(1024);
|
||||
if (wk == NULL) {
|
||||
ESP_LOGE(TAG, "malloc failed");
|
||||
while(1) { vTaskDelay(1); }
|
||||
}
|
||||
|
||||
// Allocate memory for save frame
|
||||
uint8_t *save = (uint8_t *)malloc(1024);
|
||||
if (save == 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) {
|
||||
ESP_LOGE(TAG, "malloc failed");
|
||||
while(1) { vTaskDelay(1); }
|
||||
}
|
||||
|
||||
ssd1306_contrast(&dev, 0xff);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, vehicle1, 24, 48, true);
|
||||
ssd1306_get_buffer(&dev, &vehicle[1024*0]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, vehicle2, 24, 48, true);
|
||||
ssd1306_get_buffer(&dev, &vehicle[1024*1]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, vehicle3, 24, 48, true);
|
||||
ssd1306_get_buffer(&dev, &vehicle[1024*2]);
|
||||
vTaskDelay(10);
|
||||
|
||||
ssd1306_clear_screen(&dev, false);
|
||||
ssd1306_bitmaps(&dev, 0, 0, highway1, 128, 64, false);
|
||||
vTaskDelay(10);
|
||||
|
||||
int page = 0;
|
||||
int vehicleHorizontalPosition[3] = {20, 52, 84};
|
||||
int vehicleVerticalPosition[3] = {4, 0, 2};
|
||||
int vehicleVerticalMove[3] = {-1, 1, -1};
|
||||
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);
|
||||
|
||||
// Set vehicle image
|
||||
for (int vehicleFrame=0;vehicleFrame<3;vehicleFrame++) {
|
||||
int startPage = vehicleVerticalPosition[vehicleFrame];
|
||||
int endPage = startPage+6;
|
||||
ESP_LOGD(TAG, "page=%d vehicleVerticalPosition1=%d startPage=%d endPage=%d",
|
||||
page, vehicleVerticalPosition[vehicleFrame], startPage, endPage);
|
||||
int vehicleIndex = vehicleFrame * 1024;
|
||||
int vehicleOffset = 0;
|
||||
for(int _page=startPage;_page<endPage;_page++) {
|
||||
for(int seg=0;seg<24;seg++) {
|
||||
int bufferIndex = _page*128+seg+vehicleHorizontalPosition[vehicleFrame];
|
||||
if (bufferIndex < 1023)
|
||||
wk[bufferIndex] = vehicle[vehicleIndex+vehicleOffset*128+seg];
|
||||
}
|
||||
vehicleOffset++;
|
||||
}
|
||||
}
|
||||
|
||||
ssd1306_set_buffer(&dev, wk);
|
||||
#endif
|
||||
|
||||
// Show internal buffer
|
||||
ssd1306_show_buffer(&dev);
|
||||
|
||||
#if WITH_VEHICLE
|
||||
// Set frame without vehicle
|
||||
ssd1306_set_buffer(&dev, save);
|
||||
#endif
|
||||
|
||||
page++;
|
||||
if (page > 7) {
|
||||
page = 0;
|
||||
for (int vehicleFrame=0;vehicleFrame<3;vehicleFrame++) {
|
||||
vehicleVerticalPosition[vehicleFrame] = vehicleVerticalPosition[vehicleFrame] + vehicleVerticalMove[vehicleFrame];
|
||||
if (vehicleVerticalPosition[vehicleFrame] == 8) {
|
||||
vehicleVerticalPosition[vehicleFrame] = 7;
|
||||
vehicleVerticalMove[vehicleFrame] = -1;
|
||||
}
|
||||
if (vehicleVerticalPosition[vehicleFrame] == -1) {
|
||||
vehicleVerticalPosition[vehicleFrame] = 0;
|
||||
vehicleVerticalMove[vehicleFrame] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end while
|
||||
|
||||
}
|
18
CarRaceDemo/sdkconfig.defaults
Normal file
@ -0,0 +1,18 @@
|
||||
#
|
||||
# ESP32-specific
|
||||
#
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
|
||||
|
||||
#
|
||||
# ESP32S2-specific
|
||||
#
|
||||
CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y
|
||||
CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=240
|
||||
|
||||
#
|
||||
# ESP32S3-specific
|
||||
#
|
||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y
|
||||
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240
|
||||
|