Robot Face Expression Engine / guide

A robot face on a 128x64 OLED that reacts to what it says

A 0.96 inch SSD1306 OLED has 8,192 pixels and one colour, so every pixel of an expression counts. The engine draws the face at the display's real resolution, then thresholds it to 1 bit, so what you see above is what the panel shows, including the lid cuts that make a happy, sad or cross face readable at that size.

Getting the pixels onto the display

FaceRenderer.oledPixels(pose, config) draws the 128x64 frame and FaceAdapters.oledBuffer(imageData) packs it into the 1024-byte page layout the SSD1306 expects (8 pages of 128 columns, one bit per pixel). Send it over I2C from a Raspberry Pi. Motion is where small OLED faces usually feel cheap: here the face still anticipates, overshoots and blinks on changes of thought, at the panel's resolution.

Get the engine, £29 Compare it with a mood swap

More guides