hello Pete
i wrote a function for that little OLED display in order to display big numbers that could be read from distance, it can display an unsigned number, formed from “#” characters.
maybe you will find it useful ))
usage: disp_1k (unsigned int 0…999)
note: it works with old 1.0.0 version of ACROBOTIC library that has 8x8 pixel characters only.
#include <ACROBOTIC_SSD1306.h> // version 1.0.0
#include <Wire.h>
void dispBig (unsigned char cprs, unsigned char pos) {
const static unsigned char
Mtx4x8[40] = {0b01111110,0b10001001,0b10010001,0b01111110,
0b00000000,0b10000001,0b11111111,0b00000001,
0b01000111,0b10001001,0b10010001,0b01100001,
0b01000010,0b10010001,0b10010001,0b01101110,
0b00011000,0b00101000,0b01001000,0b11111111,
0b11110010,0b10010001,0b10010001,0b10001110,
0b01111110,0b10010001,0b10010001,0b01001110,
0b10000000,0b10000000,0b10000000,0b11111111,
0b01101110,0b10010001,0b10010001,0b01101110,
0b01110010,0b10001001,0b10001001,0b01111110};
for (char x=0; x<=3; x++){
for(char y = 0; y <= 7 ; y++){
oled.setTextXY (7 - y, x + pos * 5);
oled.putChar (35 * ((Mtx4x8[x + (cprs * 4)] >> y) & 1));
}
}
}
void disp_1k (unsigned int ntodisp) {
if (ntodisp > 999) ntodisp = 999;
unsigned int tVal = ntodisp / 100;
dispBig (tVal,0);
ntodisp -= tVal * 100;
tVal = ntodisp / 10;
dispBig(tVal,1);
ntodisp -= tVal * 10;
dispBig (ntodisp,2);
}