//Print string s, split in multiple lines if necessary void LCD_printStr(const char *s) { char primera[lines][22] = {'\0'}; int fila = 0; char delim[5] = ", ."; //Divide s en diferentes filas y las pone en el array de chars char *word = strtok(s, delim); while (word != NULL) { if (!((strlen(primera[fila]) + strlen(word)) < width/c_width)) fila ++; if (fila >lines - 1) break; strcat(primera[fila], word); strcat(primera[fila], " "); //primera[fila] word = strtok(NULL, delim); } int i; i=0; //LCD_printMultilinea(primera, fila); dog_StartPage(); do { for (i=0; i<=fila ; i++) { dog_DrawStr(0, 52- c_height*i, font_6x13, primera[i]); } } while( dog_NextPage() ); }
//Prints SuperListas Logo void LCD_printLogo(void) { int i=0; int a = 1000; dog_StartPage(); do { dog_SetBitmap(i,63,logo_win,127,63); } while( dog_NextPage() ); __delay_ms(50); }
int main(void) { uint8_t page = 100; system_init(); dog_Init(0); for(;;) { dog_StartPage(); do { switch(page) { case 100: page_intro(); break; case 0: page0(); break; case 1: page1(); break; case 2: page2(); break; case 3: page3(); break; case 4: page4(); break; case 5: page5(); break; } } while( dog_NextPage() ); dog_Delay(1500); page++; if ( page >= 6 ) page = 0; } }
int main(void) { uint16_t adc; sys_init(); dog_Init(0); for(;;) { dog_StartPage(); do { walk_Draw(); } while( dog_NextPage() ); adc = sys_adc(); adc >>= 4; if ( adc >= 0x0f && adc < 0x30 ) dog_SetContrast(adc); dog_Delay(120); walk_Step(); } }