hexaguin / SSD1327

A full framebuffer Arduino driver for 128x128 SSD1327 OLED grayscale modules.
GNU Lesser General Public License v3.0
13 stars 5 forks source link

writing 'byte' #4

Open 5B4ALR opened 4 years ago

5B4ALR commented 4 years ago

Nice little library!

I'm trying to write "byte" on OLED, but seems that my syntax is wrong.. is it possible to get some help?

//How to print "byte" on SSD1327 OLED, using ssd1327 library byte packethour; byte packetminute; void printTimestamp() {

if (packethour < 10) { ssd1327WriteString(88, 0, (char )"0", FONT_NORMAL, 15, 0);} // (x, y, 'what to write', font type, char brightness, backround brightness) ssd1327WriteString(96, 0, (char )packethour, FONT_NORMAL, 15, 0);
//packethour is a "byte" type ssd1327WriteString(104, 0, (char )":", FONT_NORMAL, 15, 0); //8x8 if (packetminute < 10) { ssd1327WriteString(112, 0, (char )"0", FONT_NORMAL, 15, 0);}
ssd1327WriteString(120, 0, (packetminute), FONT_NORMAL, 15, 0);

} // if packethour = 3 and packetminute = 4, it should show 03:04