Hi
I tried to use u8glib (Google Code Archive - Long-term storage for Google Code Project Hosting.) with OpenMoCo.
Problem 1: After download and archive extraction into the libraries folder, the Arduino IDE complains about the root directory name. I had to rename it to something without "-" and ".". I also noticed that there is exactly only one example for the complete lib. Luckily it covers the menu manager, but i would have expected some more examples within the Arduino IDE for other parts of the lib.
Problem 2: I do not know how to setup the u8glib picture loop. More specific: I need to draw the screen more than once. The draw callback handler for u8glib is easy. Assuming a font with char width 4 and height 8 it is this:
void uiDraw(char* p_text, int p_row, int p_col, int len) {
u8g.setCursorPos(p_col*4, p_row*8);
for( int i = 0; i < len; i++ ) {
if( c < '!' || c > '~' )
u8g.write(' ');
else
u8g.write(p_text[i]);
}
}
However, the screen has to be updated several times. But i do not know how to do this. Controll is given to this lib with checkInput(), but i assume that this procedure also does the character output. Pseudocode for u8glib is this:
- check keys
- handle keys
- several times: redraw screen
I looked into the code, but did not find how to do 3)
Any ideas?
Oliver