// ← back to all

eyes_look_right

// eyes_look_right · by 0x1306 · 6 frames · 125ms · robot_eyes
// views · runs
// preview
frame_00 / 06// 125ms per frame
// space: play/pause · ←→: step frames
123456789101112131415161718192021222324252627282930313233343536
#include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> // 0x1306.dev · animation: eyes_look_right · robot_eyes · 125ms #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET -1 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); void drawEyes(int lx, int ly, int lw, int lh, int lr, int rx, int ry, int rw, int rh, int rr) { display.fillRoundRect(lx - lw/2, ly - lh/2, lw, lh, lr, WHITE); display.fillRoundRect(rx - rw/2, ry - rh/2, rw, rh, rr, WHITE); } void drawFrame(int frame) { display.clearDisplay(); int ox[] = {0, 4, 8, 10, 8, 4}; drawEyes(32, 32, 38, 28, 8, 96, 32, 38, 28, 8); display.fillCircle(32 + ox[frame], 32, 8, BLACK); display.fillCircle(96 + ox[frame], 32, 8, BLACK); display.display(); } void setup() { Wire.begin(21, 22); display.begin(SSD1306_SWITCHCAPVCC, 0x3C); } void loop() { for (int i = 0; i < 6; i++) { drawFrame(i); delay(125); } }
// share
// embed
// paste into any html · 320×200 · transparent click opens detail page