Hi!
I have two green Sure 3208 modules wired up. I use the MilesBurton library and some code copied from can't-remember-where. I have everything else working properly, even got 5x8 fonts working, but I can't figure out how to display special characters, the ones I need are Ä and Ö. Here's the code involving the characters:
/*
* Copy a character glyph from the myfont data structure to
* display memory, with its upper left at the given coordinate
* This is unoptimized and simply uses setPixel() to draw each dot.
*/
void drawChar(uint8_t x, uint8_t y, char c)
{
uint8_t dots;
if (c >= '!' && c <= '~') {
c = (c - 32); // Fonts start from A, left ASCII commands out..
}
else if (c == 'Ä') { // Ä
c = 99;
}
else if (c == 'Ö') { // Ö
c = 97;
}
else if (c == ' ') {
c = 0; // space
}
else c = 0;
for (char col=0; col< 5; col++) {
dots = pgm_read_byte_near(&myfont[c][col]);
for (char row=0; row < 8 ; row++) {
if (dots & (128>>row)) // Had a problem wit this, had to change (64>>row) to (128>>row) to get this to work with 5x8 fonts (orig. 5x7)
toolbox.setPixel(x+col, y+row-1, 1); // Had to change this too, orig. toolbox.setPixel(x+col, y+row, 1);
else
toolbox.setPixel(x+col, y+row-1, 0); // orig. toolbox.setPixel(x+col, y+row, 0);
}
}
}
// Write out an entire string (Null terminated)
void drawString(uint8_t x, uint8_t y, char* c)
{
for(char i=0; i< strlen(c); i++)
{
drawChar(x, y, c[i]);
x+=6; // Width of each glyph
}
}
Any ideas?