// ← back to all
auto_rickshaw
// auto_rickshaw · by 0x1306 · 6 frames · 100ms · indian
// — views · — runs
// preview
frame_00 / 06// 100ms per frame
// space: play/pause · ←→: step frames
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970#include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> // 0x1306.dev · animation: auto_rickshaw · 6 frames · 100ms #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET -1 #define SCREEN_ADDRESS 0x3C Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); #define FRAME_COUNT 6 #define FRAME_DELAY 100 void drawFrame(int frame) { display.clearDisplay(); int cx = 64; int cy = 32; // --- chassis --- display.drawLine(cx - 15, cy + 10, cx + 10, cy + 10, WHITE); display.drawLine(cx + 10, cy + 10, cx + 15, cy, WHITE); display.drawLine(cx + 15, cy, cx + 8, cy - 12, WHITE); display.drawLine(cx + 8, cy - 12, cx - 12, cy - 12, WHITE); display.drawLine(cx - 12, cy - 12, cx - 15, cy + 10, WHITE); // --- roof and window --- display.fillRect(cx - 15, cy - 12, 23, 2, WHITE); display.drawLine(cx - 10, cy - 10, cx + 5, cy - 10, WHITE); display.drawLine(cx + 5, cy - 10, cx + 12, cy, WHITE); display.drawLine(cx + 12, cy, cx + 8, cy, WHITE); display.drawLine(cx + 8, cy, cx + 2, cy - 8, WHITE); display.drawLine(cx + 2, cy - 8, cx - 10, cy - 8, WHITE); display.drawLine(cx - 10, cy - 8, cx - 10, cy - 10, WHITE); // --- wheels --- int driveX = cx - 10; int frontX = cx + 12; int wY = cy + 10; display.drawCircle(driveX, wY, 4, WHITE); display.drawCircle(frontX, wY, 3, WHITE); // --- spokes --- int8_t spokeAngles[] = {0, 30, 60, 90, 120, 150}; float angle = spokeAngles[frame % 6] * (PI / 180.0); display.drawLine(driveX, wY, driveX + 4 * cos(angle), wY + 4 * sin(angle), WHITE); display.drawLine(driveX, wY, driveX - 4 * cos(angle), wY - 4 * sin(angle), WHITE); display.drawLine(frontX, wY, frontX + 3 * cos(angle), wY + 3 * sin(angle), WHITE); display.drawLine(frontX, wY, frontX - 3 * cos(angle), wY - 3 * sin(angle), WHITE); display.display(); } void setup() { Wire.begin(21, 22); // SDA=21, SCL=22 for ESP32 DevKit // change to 0x3D if display not found display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS); display.clearDisplay(); display.display(); } void loop() { for (int i = 0; i < FRAME_COUNT; i++) { drawFrame(i); delay(FRAME_DELAY); } }
// share
// embed
// paste into any html · 320×200 · transparent click opens detail page