ESP32 OLED SD Updater Library for DSTIKE Boards
This library is made for the DSTIKE D-duino-32 Final and DSTIKE ESP32 Watch DevKit OLED.
But it can also run on other boards that fulfill these requirements:
- ESP32 SoC
- OLED display (SSD1306 or SH1106) with 128x64 pixel
- Up, down and select buttons as input pullup
- SD card slot connected to the SD/MMC pins (check this example)
-
Click Download Zip to download the source code from GitHub.
-
Unzip and rename the Folder name to "DstikeUpdater".
-
Paste it in your library folder (usually located somewhere at documents/Arduino/libraries).
-
Restart the Arduino IDE.
-
Install the OLED library using the same steps, from ThingPulse/esp8266-oled-ssd1306
- Include the library
#include <DstikeUpdater.h>
- In the begin of
void setup()
addDstikeUpdater::run()
Example for DSTIKE D-duino-32 Final:
#include <DstikeUpdater.h> // Include updater library
// Pin definitions
#define BUTTON_UP 32
#define BUTTON_DOWN 25
#define BUTTON_SELECT 33
#define OLED_SDA 26
#define OLED_SCK 27
void setup() {
// Run updater
DstikeUpdater::runSH1106(OLED_SDA, OLED_SCK, BUTTON_UP, BUTTON_DOWN, BUTTON_SELECT);
// ...
}
void loop() {
// ...
}
Definition of the run
method:
static void run(OLEDDisplay & display, int up, int down, int select, const char* path = UPDATER_PATH, int loadingDelay = LOADING_DELAY);
static void runSH1106(int sda, int sck, int up, int down, int select, const char* path = UPDATER_PATH, int loadingDelay = LOADING_DELAY);
static void runSSD1306(int sda, int sck, int up, int down, int select, const char* path = UPDATER_PATH, int loadingDelay = LOADING_DELAY);
UPDATER_PATH
defaults to "/update"
.
LOADING_DELAY
defaults to 3500
.
- Get a micro SD card and format it to FAT32
- Create the
update
folder in root - Move your
*.bin
files in theupdate
folder (SD:\update\yourfile.bin
) - Power up your board
- Press a button in the first 3 seconds to start the updater
- Select a file to flash it
This software is licensed under the MIT License. See the license file for details.