Adapting Arduino BASIC to the SMART Response XE terminal was quite easy as the interface was limited to a pair of functions that were easy to replace with the ones in the Low Level Library.
But the display is not that large and the limitation imposed by its graphic controler lead to some problems. The contraint is that font width shall be multiple of 3. You can have small fonts that give many lines with many characters difficult to read (for my eyes at least) or large fonts that are easy to read but with less lines with less characters. It made me want to be able to change the font at any moment.. The low level library alreay defines 4 fonts
Font name | Font size | # of char per line | # of lines per frame | Comment |
NORMAL | 9 x 8 | 42 | 17 | fill screen |
SMALL | 6 x | 64 | 17 | fill screen |
MEDIUM | 12 x 16 | 32 | 8 | 8 unused lines |
LARGE | 15 x 16 | 25 | 8 | 8 unused lines |
As the larger fonts leave 8 lines I decided to do the same for the smaller ones. The 8 unused lines will be used to display some information on screen.
The cpp file in which the interface with the host is defined was upgraded in order to be able to change the font on the fly. I first defined a structure that holds parameters depending on the font size. And replaced all the constants with members of the structure.
The terminal has some "special" keys. I used the menu one to launch a function with which I can change the font.
The 8 unused lines are located at the bottom of the screen. They display the status of the terminal. Actually, battery level, font used and memory usage.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.