Trying to create a custom font to use for my project, looking at the default fonts inside the library, there's some examples. 4x6 6x8 8x8 8x8ext seems simple enough? right? so I drew on paper a font that I might like, then drew it in paint on PC. still looked nice to me. next is to write an array holding all the data. but how to write an array for a character with 10x17 pixels? I know I need 17 lines but how to fill the data for 10 pixels wide?
is it something like this? or do I need to use a different format?:
PROGMEM const unsigned char mycustomfont[] = {
10,17,0,
// Should start with a space normally, but this is an example. #number: 0
0b0001111000,
0b0011111100,
0b0101111010,
0b1110000111,
0b1110000111,
0b1110000111,
0b1110000111,
0b0100000010,
0b0000000000,
0b0100000010,
0b1110000111,
0b1110000111,
0b1110000111,
0b1110000111,
0b0101111010,
0b0011111100,
0b0001111000,
// #number: 1
0b0000000000,
0b0000000000,
0b0000000010,
0b0000000111,
0b0000000111,
0b0000000111,
0b0000000111,
0b0000000010,
0b0000000000,
0b0000000010,
0b0000000111,
0b0000000111,
0b0000000111,
0b0000000111,
0b0000000010,
0b0000000000,
0b0000000000,
};
Update:
I got something to display on the screen changing the TVoutPalDemo. But I wonder why is it flickering in the loop so heavily? In the setup, the image is still, the numbers are still.
I was expecting the loop sequence to also be without flickering. I'm suspecting I need to sync somewhere to get no flickerings. (still images need to remain still.)
#include <TVout.h>
TVout TV;
unsigned long loops = 0;
// 'ScreenTest', 120x96px
const unsigned char ScreenTest [] PROGMEM = { 120, 96,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd5, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x57, 0xc0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd2, 0xdd, 0xef, 0xbf, 0x7f, 0x7f,
0xbf, 0xef, 0xfd, 0xfe, 0xfe, 0xfd, 0xf7, 0xbb, 0x43, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd3, 0x77, 0xbe, 0xfc, 0xf1, 0xe0, 0x22, 0x15,
0x55, 0x55, 0x54, 0xcc, 0xcc, 0xcc, 0xc3, 0xc3, 0x77, 0xbe, 0xfd, 0x0a, 0x10, 0x77, 0x2a, 0xaa,
0xaa, 0xaa, 0xcc, 0xcc, 0xcc, 0xc3, 0xd0, 0x77, 0xbe, 0xfd, 0x0a, 0xd0, 0x7f, 0x15, 0x55, 0x55,
0x54, 0xcc, 0xcc, 0xcc, 0xc3, 0xc0, 0x07, 0xbe, 0xfd, 0x0a, 0xd0, 0x3e, 0x2a, 0xaa, 0xaa, 0xaa,
0xcc, 0xcc, 0xcc, 0xc3, 0xd0, 0x00, 0x3e, 0xfd, 0x0a, 0x10, 0x1c, 0x15, 0x55, 0x55, 0x54, 0xcc,
0xcc, 0xcc, 0xc3, 0xc0, 0x00, 0x00, 0xfc, 0xf1, 0xe0, 0x08, 0x2a, 0xaa, 0xaa, 0xaa, 0xcc, 0xcc,
0xcc, 0xc3, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3,
0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc3,
0x77, 0xbe, 0xfc, 0x88, 0x09, 0xdc, 0xf3, 0x99, 0xff, 0xc7, 0x02, 0x0f, 0x8f, 0x83, 0xd2, 0x67,
0x3c, 0xf9, 0x94, 0x18, 0x5e, 0x79, 0xcc, 0xff, 0x8f, 0x87, 0x17, 0x50, 0x43, 0xc0, 0x46, 0x38,
0xf0, 0x94, 0x08, 0x5f, 0x3c, 0xe6, 0x7f, 0x1f, 0xcf, 0x90, 0x55, 0x43, 0xd0, 0x04, 0x30, 0xe0,
0x95, 0x48, 0x9f, 0x9e, 0x73, 0x3e, 0x0f, 0x87, 0x15, 0x50, 0x43, 0xc0, 0x00, 0x20, 0xc0, 0x94,
0x88, 0x9f, 0xcf, 0x39, 0x9c, 0x07, 0x02, 0x10, 0x57, 0x43, 0xd0, 0x00, 0x00, 0x81, 0xc9, 0x5c,
0x9f, 0xe7, 0x9c, 0xc8, 0x02, 0x00, 0x0f, 0x8f, 0x83, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd0, 0x78, 0x00, 0x01, 0xe0, 0x3c, 0x00, 0x00, 0xf0, 0x1e,
0x03, 0xc0, 0x78, 0x0f, 0x03, 0xc0, 0xfc, 0x00, 0x03, 0xf0, 0x7e, 0x00, 0x01, 0xf8, 0x3f, 0x07,
0xe0, 0xfc, 0x1f, 0x83, 0xd1, 0x7a, 0x00, 0x41, 0xe8, 0x3d, 0x10, 0x22, 0xf0, 0x5e, 0x03, 0xd1,
0x7a, 0x2f, 0x43, 0xc3, 0x87, 0x00, 0xe0, 0x1c, 0x03, 0xb8, 0x77, 0x00, 0xe0, 0x00, 0x3b, 0x87,
0x70, 0xe3, 0xd3, 0x87, 0x00, 0xe0, 0x1c, 0x03, 0xb8, 0x77, 0x00, 0xe0, 0x00, 0x3b, 0x87, 0x70,
0xe3, 0xc3, 0x87, 0x00, 0xe0, 0x1c, 0x03, 0xb8, 0x77, 0x00, 0xe0, 0x00, 0x3b, 0x87, 0x70, 0xe3,
0xd3, 0x87, 0x00, 0xe0, 0x1c, 0x03, 0xb8, 0x77, 0x00, 0xe0, 0x00, 0x3b, 0x87, 0x70, 0xe3, 0xc1,
0x02, 0x00, 0x41, 0xe8, 0x3d, 0x17, 0xa2, 0xf0, 0x5e, 0x00, 0x11, 0x7a, 0x2f, 0x43, 0xd0, 0x00,
0x00, 0x03, 0xf0, 0x7e, 0x0f, 0xc1, 0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x1f, 0x83, 0xc1, 0x02, 0x00,
0x45, 0xe0, 0x3d, 0x07, 0xa0, 0xf4, 0x5e, 0x80, 0x11, 0x7a, 0x0f, 0x43, 0xd3, 0x87, 0x00, 0xee,
0x00, 0x03, 0x80, 0x70, 0x0e, 0xe1, 0xc0, 0x3b, 0x87, 0x00, 0xe3, 0xc3, 0x87, 0x00, 0xee, 0x00,
0x03, 0x80, 0x70, 0x0e, 0xe1, 0xc0, 0x3b, 0x87, 0x00, 0xe3, 0xd3, 0x87, 0x00, 0xee, 0x00, 0x03,
0x80, 0x70, 0x0e, 0xe1, 0xc0, 0x3b, 0x87, 0x00, 0xe3, 0xc3, 0x87, 0x00, 0xee, 0x00, 0x03, 0x80,
0x70, 0x0e, 0xe1, 0xc0, 0x3b, 0x87, 0x00, 0xe3, 0xd1, 0x7a, 0x00, 0x45, 0xe0, 0x3d, 0x00, 0x20,
0xf4, 0x5e, 0x80, 0x11, 0x7a, 0x0f, 0x43, 0xc0, 0xfc, 0x00, 0x03, 0xf0, 0x7e, 0x00, 0x01, 0xf8,
0x3f, 0x00, 0x00, 0xfc, 0x1f, 0x83, 0xd0, 0x78, 0x00, 0x01, 0xe0, 0x3c, 0x00, 0x00, 0xf0, 0x1e,
0x00, 0x00, 0x78, 0x0f, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0xd0, 0x78, 0x00, 0x01, 0xe0, 0x00, 0x07, 0x80, 0xf0, 0x1e, 0x00, 0x00,
0x00, 0x00, 0x03, 0xc0, 0xfc, 0x00, 0x03, 0xf0, 0x00, 0x0f, 0xc1, 0xf8, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x03, 0xd1, 0x7a, 0x20, 0x05, 0xe0, 0x01, 0x17, 0x82, 0xf0, 0x5e, 0x88, 0x11, 0x00, 0x00,
0x43, 0xc3, 0x87, 0x70, 0x0e, 0x00, 0x03, 0xb8, 0x07, 0x00, 0xe1, 0xdc, 0x3b, 0x80, 0x00, 0xe3,
0xd3, 0x87, 0x70, 0x0e, 0x00, 0x03, 0xb8, 0x07, 0x00, 0xe1, 0xdc, 0x3b, 0x80, 0x00, 0xe3, 0xc3,
0x87, 0x70, 0x0e, 0x00, 0x03, 0xb8, 0x07, 0x00, 0xe1, 0xdc, 0x3b, 0x80, 0x00, 0xe3, 0xd3, 0x87,
0x70, 0x0e, 0x00, 0x03, 0xb8, 0x07, 0x00, 0xe1, 0xdc, 0x3b, 0x80, 0x00, 0xe3, 0xc1, 0x7a, 0x2f,
0x04, 0x00, 0x3d, 0x17, 0x82, 0xf0, 0x5e, 0x8b, 0xd1, 0x00, 0x00, 0x43, 0xd0, 0xfc, 0x1f, 0x80,
0x00, 0x7e, 0x0f, 0xc1, 0xf8, 0x3f, 0x07, 0xe0, 0x00, 0x00, 0x03, 0xc1, 0x7a, 0x2f, 0x44, 0x00,
0xbd, 0x17, 0x82, 0xf0, 0x1e, 0x8b, 0xd1, 0x00, 0x00, 0x43, 0xd3, 0x87, 0x70, 0xee, 0x01, 0xc3,
0xb8, 0x07, 0x00, 0x01, 0xdc, 0x3b, 0x80, 0x00, 0xe3, 0xc3, 0x87, 0x70, 0xee, 0x01, 0xc3, 0xb8,
0x07, 0x00, 0x01, 0xdc, 0x3b, 0x80, 0x00, 0xe3, 0xd3, 0x87, 0x70, 0xee, 0x01, 0xc3, 0xb8, 0x07,
0x00, 0x01, 0xdc, 0x3b, 0x80, 0x00, 0xe3, 0xc3, 0x87, 0x70, 0xee, 0x01, 0xc3, 0xb8, 0x07, 0x00,
0x01, 0xdc, 0x3b, 0x80, 0x00, 0xe3, 0xd1, 0x02, 0x2f, 0x45, 0xe0, 0xbd, 0x17, 0x82, 0x00, 0x1e,
0x88, 0x11, 0x00, 0x0f, 0x43, 0xc0, 0x00, 0x1f, 0x83, 0xf0, 0x7e, 0x0f, 0xc0, 0x00, 0x3f, 0x00,
0x00, 0x00, 0x1f, 0x83, 0xd0, 0x00, 0x0f, 0x01, 0xe0, 0x3c, 0x07, 0x80, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x0f, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xd0, 0x00, 0x0f, 0x01, 0xe0, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00,
0x03, 0xc0, 0x00, 0x1f, 0x83, 0xf0, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x03,
0xd1, 0x00, 0x2f, 0x45, 0xe8, 0xbd, 0x10, 0x02, 0x04, 0x00, 0x00, 0x01, 0x7a, 0x20, 0x03, 0xc3,
0x80, 0x70, 0xee, 0x1d, 0xc3, 0xb8, 0x07, 0x0e, 0x00, 0x00, 0x03, 0x87, 0x70, 0x03, 0xd3, 0x80,
0x70, 0xee, 0x1d, 0xc3, 0xb8, 0x07, 0x0e, 0x00, 0x00, 0x03, 0x87, 0x70, 0x03, 0xc3, 0x80, 0x70,
0xee, 0x1d, 0xc3, 0xb8, 0x07, 0x0e, 0x00, 0x00, 0x03, 0x87, 0x70, 0x03, 0xd3, 0x80, 0x70, 0xee,
0x1d, 0xc3, 0xb8, 0x07, 0x0e, 0x00, 0x00, 0x03, 0x87, 0x70, 0x03, 0xc1, 0x00, 0x20, 0x44, 0x08,
0xbd, 0x17, 0x82, 0x04, 0x1e, 0x03, 0xc1, 0x7a, 0x20, 0x03, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x7e,
0x0f, 0xc0, 0x00, 0x3f, 0x07, 0xe0, 0xfc, 0x00, 0x03, 0xc1, 0x00, 0x20, 0x44, 0x08, 0xbc, 0x17,
0x82, 0x04, 0x1e, 0x03, 0xc0, 0x78, 0x00, 0x03, 0xd3, 0x80, 0x70, 0xee, 0x1d, 0xc0, 0x38, 0x07,
0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc3, 0x80, 0x70, 0xee, 0x1d, 0xc0, 0x38, 0x07, 0x0e,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd3, 0x80, 0x70, 0xee, 0x1d, 0xc0, 0x38, 0x07, 0x0e, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0xc3, 0x80, 0x70, 0xee, 0x1d, 0xc0, 0x38, 0x07, 0x0e, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0xd1, 0x78, 0x20, 0x05, 0xe8, 0x80, 0x17, 0x82, 0xf4, 0x1e, 0x00, 0x00,
0x00, 0x00, 0x03, 0xc0, 0xfc, 0x00, 0x03, 0xf0, 0x00, 0x0f, 0xc1, 0xf8, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x03, 0xd0, 0x78, 0x00, 0x01, 0xe0, 0x00, 0x07, 0x80, 0xf0, 0x1e, 0x00, 0x00, 0x00, 0x00,
0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0xd0, 0x78, 0x0f, 0x01, 0xe0, 0x00, 0x07, 0x80, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x03, 0xc0,
0xfc, 0x1f, 0x83, 0xf0, 0x00, 0x0f, 0xc1, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x83, 0xd1, 0x78,
0x2f, 0x41, 0xe8, 0x81, 0x17, 0x80, 0xf4, 0x40, 0x00, 0x11, 0x02, 0x0f, 0x03, 0xc3, 0x80, 0x70,
0xe0, 0x1d, 0xc3, 0xb8, 0x00, 0x0e, 0xe0, 0x00, 0x3b, 0x87, 0x00, 0x03, 0xd3, 0x80, 0x70, 0xe0,
0x1d, 0xc3, 0xb8, 0x00, 0x0e, 0xe0, 0x00, 0x3b, 0x87, 0x00, 0x03, 0xc3, 0x80, 0x70, 0xe0, 0x1d,
0xc3, 0xb8, 0x00, 0x0e, 0xe0, 0x00, 0x3b, 0x87, 0x00, 0x03, 0xd3, 0x80, 0x70, 0xe0, 0x1d, 0xc3,
0xb8, 0x00, 0x0e, 0xe0, 0x00, 0x3b, 0x87, 0x00, 0x03, 0xc1, 0x00, 0x20, 0x41, 0xe8, 0xbd, 0x17,
0x80, 0x04, 0x5e, 0x03, 0xd1, 0x02, 0x0f, 0x03, 0xd0, 0x00, 0x00, 0x03, 0xf0, 0x7e, 0x0f, 0xc0,
0x00, 0x3f, 0x07, 0xe0, 0x00, 0x1f, 0x83, 0xc0, 0x00, 0x00, 0x01, 0xe0, 0x3c, 0x07, 0x80, 0x00,
0x1e, 0x03, 0xc0, 0x00, 0x0f, 0x03, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// '0', 11x18px
const unsigned char number_0 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x2f, 0x40, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
0x20, 0x40, 0x00, 0x00, 0x20, 0x40, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x2f, 0x40,
0x1f, 0x80, 0x0f, 0x00
};
// '1', 11x18px
const unsigned char number_1 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0,
0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0x40,
0x00, 0x00, 0x00, 0x00
};
// '2', 11x18px
const unsigned char number_2 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x0f, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0,
0x0f, 0x40, 0x1f, 0x80, 0x2f, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x2f, 0x00,
0x1f, 0x80, 0x0f, 0x00
};
// '3', 11x18px
const unsigned char number_3 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x0f, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0,
0x0f, 0x40, 0x1f, 0x80, 0x0f, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x0f, 0x40,
0x1f, 0x80, 0x0f, 0x00
};
// '4', 11x18px
const unsigned char number_4 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
0x2f, 0x40, 0x1f, 0x80, 0x0f, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0x40,
0x00, 0x00, 0x00, 0x00
};
// '5', 11x18px
const unsigned char number_5 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x2f, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
0x2f, 0x00, 0x1f, 0x80, 0x0f, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x0f, 0x40,
0x1f, 0x80, 0x0f, 0x00
};
// '6', 11x18px
const unsigned char number_6 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x2f, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00,
0x2f, 0x00, 0x1f, 0x80, 0x2f, 0x40, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x2f, 0x40,
0x1f, 0x80, 0x0f, 0x00
};
// '7', 11x18px
const unsigned char number_7 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x0f, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0,
0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0x40,
0x00, 0x00, 0x00, 0x00
};
// '8', 11x18px
const unsigned char number_8 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x2f, 0x40, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
0x2f, 0x40, 0x1f, 0x80, 0x2f, 0x40, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x2f, 0x40,
0x1f, 0x80, 0x0f, 0x00
};
// '9', 11x18px
const unsigned char number_9 [] PROGMEM = { 11, 18,
0x00, 0x00, 0x0f, 0x00, 0x1f, 0x80, 0x2f, 0x40, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0, 0x70, 0xe0,
0x2f, 0x40, 0x1f, 0x80, 0x0f, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xe0, 0x0f, 0x40,
0x1f, 0x80, 0x0f, 0x00
};
void setup() {
TV.begin(PAL,120,96);
TV.bitmap(0,0,ScreenTest);
TV.delay(5000);
TV.clear_screen();
TV.bitmap(0,2,number_0);
TV.bitmap(11,2,number_1);
TV.bitmap(23,2,number_2);
TV.bitmap(35,2,number_3);
TV.bitmap(47,2,number_4);
TV.bitmap(59,2,number_5);
TV.bitmap(71,2,number_6);
TV.bitmap(83,2,number_7);
TV.bitmap(95,2,number_8);
TV.bitmap(109,2,number_9);
TV.delay(5000);
TV.clear_screen();
}
void loop() {
TV.clear_screen();
TV.bitmap(0,2,number_0);
TV.bitmap(11,2,number_1);
TV.bitmap(23,2,number_2);
TV.bitmap(35,2,number_3);
TV.bitmap(47,2,number_4);
TV.bitmap(59,2,number_5);
TV.bitmap(71,2,number_6);
TV.bitmap(83,2,number_7);
TV.bitmap(95,2,number_8);
TV.bitmap(109,2,number_9);
TV.delay(1000);
loops++;
}
if I remove the TV.delay(1000); line, the whole line of numbers flickers. when I add a value, the flickering is not there on the numbers 0,1,2,3,4,5,6 and 7 but remains on the numbers 8 and 9.
Update 2:
I got it to stop flickering. I used the wrong call. needed to use TV.delay_frame(1); instead of TV.delay(1000);
void loop() {
TV.clear_screen();
TV.bitmap(0,2,number_0);
TV.bitmap(11,2,number_1);
TV.bitmap(23,2,number_2);
TV.bitmap(35,2,number_3);
TV.bitmap(47,2,number_4);
TV.bitmap(59,2,number_5);
TV.bitmap(71,2,number_6);
TV.bitmap(83,2,number_7);
TV.bitmap(95,2,number_8);
TV.bitmap(109,2,number_9);
TV.delay_frame(1);
loops++;
}
Update 3:
I got it to do a loop counter. (simulating scoring) and it looks nice so far. the code for it is very nasty, I won't post it yet.