|
|||||||
![]() |
Forum Index > Projects > Micro-readerboard project support | ||
Font table help |
|||
| | | Printable Version |
|
theyallhateme | ||||||||
|
Let me start by saying that I'm a noob to programming. I've only been tinkering with my Arduino for about a year. |
![]() Apprentice ![]() Status: offline
Registered: 12/13/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
Now I'm in the tweaking phase. Using the tech sheet, I was able to change the "A" font into a more classic, readable style. So it sounds like you have the basic idea of translating between the data tables and the display already. Anyway, what I'd like to do now is add numbers to the font table so I can add dates to quotes; but I don't really understand how the the decimal values correspond to what's been typed in the string. What you'll probably want to do is add the ten characters to the font_table. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
theyallhateme | ||||||||
Quote by: WindellI presume that you're using the "newer" version of the code from here: http://www.evilmadscientist.com/source/LED_MRB2.1.zip
PHP Formatted Code const unsigned int font_table[] PROGMEM = { 51609,63940,12689, //A,B,C 47556,12697,16793, //D,E,F 31121,51225,12740, //G,H,I 47105,1561,12305, //J,K,L 35377,35889,47505, //M,N,O 49561,48529,50585, //P,Q,R 31128,452,47121, //S,T,U 531,35859,1570, //V,W,X 548,13186, //Y,Z 18030, //Asterisk ('*') character. 514, //Forward slash ('/') character. 48019, // 0 34816,61833,63872, // 1,2,3 51224,13720,31129, // 4,5,6 35200,63897,63896 // 7,8,9 };
PHP Formatted Code if (buf[i] == ' ')FontWord = 0; else if (buf[i] == '*') FontWord = (uint16_t)pgm_read_word(&font_table[26]); else if (buf[i] == '/') FontWord = (uint16_t)pgm_read_word(&font_table[27]); else if (buf[i] == '0') FontWord = (uint16_t)pgm_read_word(&font_table[28]); else if (buf[i] == '1') FontWord = (uint16_t)pgm_read_word(&font_table[29]); else if (buf[i] == '2') FontWord = (uint16_t)pgm_read_word(&font_table[30]); else if (buf[i] == '3') FontWord = (uint16_t)pgm_read_word(&font_table[31]); else if (buf[i] == '4') FontWord = (uint16_t)pgm_read_word(&font_table[32]); else if (buf[i] == '5') FontWord = (uint16_t)pgm_read_word(&font_table[33]); else if (buf[i] == '6') FontWord = (uint16_t)pgm_read_word(&font_table[34]); else if (buf[i] == '7') FontWord = (uint16_t)pgm_read_word(&font_table[35]); else if (buf[i] == '8') FontWord = (uint16_t)pgm_read_word(&font_table[36]); else if (buf[i] == '9') FontWord = (uint16_t)pgm_read_word(&font_table[37]); else FontWord = (uint16_t)pgm_read_word(&font_table[buf[i] - 'A']); //Note: The ASCII char 'A' is element 0 of the font table.
PHP Formatted Code avrdude: ERROR: address 0x0810 out of range at line 129 of mrb.hexavrdude: write to file 'mrb.hex' failed
|
![]() Apprentice Status: offline
Registered: 12/13/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
You may have exceeded the available flash space. Try reducing the number and/or length of text strings, to see if that fixes it. PHP Formatted Code if (buf[i] == ' ')FontWord = 0; else if (buf[i] == '*') FontWord = (uint16_t)pgm_read_word(&font_table[26]); else if (buf[i] == '/') FontWord = (uint16_t)pgm_read_word(&font_table[27]); else if (buf[i] <= '9') FontWord = (uint16_t)pgm_read_word(&font_table[buf[i] - 20]); else FontWord = (uint16_t)pgm_read_word(&font_table[buf[i] - 'A']); Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
theyallhateme | ||||||||
|
That streamlined digit case did the trick. I used that without removing any strings, and it worked. I had a feeling I was doing it wrong, because it was too easy. |
![]() Apprentice ![]() Status: offline
Registered: 12/13/11 |
||||||||
|
|||||||||
|
|
| All times are PDT. The time is now 07:46 AM. |
|
|
Octolively
Interactive LED kits
Meggy Jr RGB
LED matrix game
development kit.
Business-card sized
AVR target boards
Peggy 2
LED Pegboard kits