Close

OLED graphics commands work!

A project log for KSP Gegi

Kerbal Space Program physical status and control panel

Maciej WitkowiakMaciej Witkowiak 01/10/2016 at 11:590 Comments

As mentioned in one of earlier logs, I have implemented OLED drawing capability as a simple interpreter for graphics string commands sent over serial link.

There are now seven commands available:

Whole graphics string must implement whole scene. The screen is refreshed only when new graphics string is received.

Here is an example of such string:

FRAME 0 0 10 16 FRAME 10 0 10 24 FRAME 0 16 127 16 PIXEL 23 23 STRING 0 32 Line1\

I had just enough memory left to have this implemented with some additional serial debug commands.

Only then I learned about font variants in u8glib and I changed:

u8g.setFont(u8g_font_unifont);
to
u8g.setFont(u8g_font_unifontr);
The 'r' version has only glyphs for codes 0x20-0x7f, but that's exactly what I need.

There is again enough of flash memory left to implement a test mode - to have some blinking lights without Python kRPC interface attached.

Discussions