ESP-12F Rotating Astronaut OLED Display
#include <Wire.h>#include <Adafruit_GFX.h>#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128#define SCREEN_HEIGHT 64int fps = 40;
#define OLED_RESET -1Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#include "images_invert.h"
void setup() {
Serial.begin(115200);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
while (true); // halt if display init fails
}
}
void loop() {
display.clearDisplay();
display.drawBitmap(0, 0, gImage_1, 128, 64, 1);
display.display();
delay(fps);
display.clearDisplay();
display.drawBitmap(0, 0, gImage_2, 128, 64, 1);
display.display();
delay(fps);
// (Repeated frames up to gImage_20...)
display.clearDisplay();
display.drawBitmap(0, 0, gImage_20, 128, 64, 1);
display.display();
delay(fps);
}Taking the Mold
1. Open the target image folder.
2. Import an image sequence.
3. Select Batch Conversion — this converts each frame (128×64 = 1024 bits) into a 16-bit.c file.
4. All generated.c files are stored in the batch folder.
5. Copy the bitmap data from each.c file and merge into a single file named images.h.
89 projects • 30 followers
Ai-Thinker is a leading supplier of IoT wireless products and solutions, including antennas, modules, and RF lab services.
![[DIY] ESP-12F Rotating Astronaut OLED Display](https://prod.hackster-cdn.online/assets/transparent-a0c1e3063bcabc548a5f3fa7328f3c1c97f747e6e764da4c14439567baa79ae1.gif)

Comments