When the OLED initialize block is used, it sets up the Propeller microcontroller to communicate with the Color OLED module. The OLED initialize block installs 1 small font, which allows you to print text and numbers to the OLED module’s screen. You may want to use a medium or large sized font instead. In order to use different fonts, you will have to install them into the EEPROM memory on your Activity Board.
The EEPROM memory on the Activity Board and Propeller FLiP can hold up to 64 kilobytes (KB) of data. The first 32 KB is used to hold your programs when you click “Save to EEPROM”. The remaining memory — often called upper EEPROM — is used to hold information that can be accessed by the programs you write.
The chart below illustrates how the EEPROM is used. When you install the Display Fonts, they use about 23 KB of EEPROM memory:
If you look carefully at the chart above, when Fonts are installed, there are about 7.8 kilobytes available for other uses. In BlocklyProp, that area is accessible via the Memory > EEPROM blocks.
Installing the fonts does not actually require any circuits, not even the OLED itself. The program to install the fonts is only a single block.
Four Fonts, Three Sizes — The default Sans font style does not need the OLED font loader block. But once you have loaded the OLED font loader block project to EEPROM, you have the fancy Serif, Script, and Bubble fonts to use. Here are the sizes available to each font:
Fixed-width & fixed-height Fonts — This means that each character takes up the same amount of space. This makes it much easier to predict where characters will appear on your screen.
The width of each character increases by 6 pixels from small (6 pixels wide) to medium (12 pixels wide) to large (18 pixels wide). The height increases by 8 pixels from small (8 pixels tall) to medium (16 pixels tall) to large (24 pixels tall). Because there is a 1 pixel spacer on the right and top of each character, the actual character size is 1 pixel less:
Now that you have loaded fonts to your Propeller board’s EEPROM, you are ready to experiment with those different fonts and sizes. By default, the OLED print text block will use the Sans font in size small. You can now change that with the OLED text size block.
By default, the OLED print text block will use white text on a black background. The OLED font color block adds another element of fun and functionality!
Add the OLED font color block to your project, just under the OLED set text block.