void screen_putc(unsigned char c) { if (c == 8 /* backspace */) { if (screen_x > 0) screen_x--; else { if (screen_y > 0) { screen_y--; screen_x = SCREEN_WIDTH - 1; } } screen_gotoxy(screen_x, screen_y); lcd_putch((screen_x > LCD_0_WIDTH) ? 1 : 0, ' '); goto g; } else if (c == 0x0d /* newline */) { screen_x = 0; /* note: we rely on the if (screen_x == 0) to increment Y */ } else { lcd_putch((screen_x > LCD_0_WIDTH) ? 1 : 0, c); INCREMENT_X; } if (screen_x == 0) INCREMENT_Y; g: screen_gotoxy(screen_x, screen_y); }
void disp(float num) { int x1,x2,x3,x4,n,temp; static float f1; char ch1,ch2,ch3,ch4,dot='.'; n=num; temp=num; x1=n%10; n=n/10; x2=n%10; if(x2 >= 4) { RB0=1; } else { RB0=0; } n=n/10; x3=n%10; f1=num-temp; x4=f1*10; ch1=lookup(x3); ch2=lookup(x2); ch3=lookup(x1); ch4=lookup(x4); lcd_goto(0); lcd_putch(ch1); lcd_putch(ch2); lcd_putch(ch3); lcd_putch(dot); lcd_putch(ch4); lcd_puts(" deg celsu"); }
void deger_goster(unsigned int sonuc) { lcd_putch(sonuc/1000+48); lcd_putch((sonuc/100)%10+48); lcd_putch((sonuc/10)%10+48); lcd_putch(sonuc%10+48); }
void integer_yaz(unsigned int deger,char flag) { lcd_putch( deger/1000+48); lcd_putch((deger%1000)/100+48); if(flag==1)lcd_putch('.'); lcd_putch((deger%100)/10+48); lcd_putch((deger)%10+48); }
/*-----------------31.8.99 20:29-------------------- * Display 8bit bin value * printbin(0xAA,'0','1') -> 10101010 * printbin(0xAA,'_','*') -> *_*_*_*_ *--------------------------------------------------*/ void printbin(byte x, byte ch0, byte ch1) { byte i; for (i=128;i>0;i>>=1) { if ((x&i)==0) lcd_putch(ch0); else lcd_putch(ch1); } }
void lcd_indicate(char test) { lcd_goto(0x0D); __delay_us(50); lcd_putch(test); __delay_ms(500); }
/*-----------------27.5.99 20:30-------------------- * Display null terminated string *--------------------------------------------------*/ void lcd_putstr(byte *data) { while(*data) { lcd_putch(*data); data++; } }
int noinline debug_uart_put(char d, FILE * stream) { if (d == '\n') debug_uart_put('\r', stream); /* replace escape sequences */ if (d == 0x1b) d = '^'; #ifdef S1D15G10_SUPPORT lcd_putch(d); #endif /* S1D15G10_SUPPORT */ #ifdef SOFT_UART_SUPPORT soft_uart_putchar(d); #else /* SOFT_UART_SUPPORT */ while (!(usart(UCSR, A) & _BV(usart(UDRE)))); #if (HAVE_RS485TE_USART0 == 1 || HAVE_RS485TE_USART1 == 1) /* enable usart transmit complete interrupt */ usart(UCSR,B) |= _BV(usart(TXCIE)); #if (USE_USART == 0) PIN_SET(RS485TE_USART0); // enable RS485 transmitter for usart 0 #elif (USE_USART == 1) PIN_SET(RS485TE_USART1); // enable RS485 transmitter for usart 1 #endif #endif /* HAVE_RS485TE_USART0 == 1 || HAVE_RS485TE_USART1 == 1 */ usart(UDR) = d; #endif /* SOFT_UART_SUPPORT */ return 0; }
int noinline debug_uart_put(char d, FILE * stream) { if (d == '\n') debug_uart_put('\r', stream); /* replace escape sequences */ if (d == 0x1b) d = '^'; #ifdef S1D15G10_SUPPORT lcd_putch(d); #endif /* S1D15G10_SUPPORT */ #ifdef SOFT_UART_SUPPORT soft_uart_putchar(d); #else /* SOFT_UART_SUPPORT */ while (!(usart(UCSR, A) & _BV(usart(UDRE)))); #if RS485_HAVE_TE /* enable interrupt usart transmit complete */ usart(UCSR,B) |= _BV(usart(TXCIE)); RS485_ENABLE_TX; #endif /* RS485_HAVE_TE */ usart(UDR) = d; #endif /* SOFT_UART_SUPPORT */ return 0; }
/*-----------------1.6.99 16:39--------------------- * Display byte in hex (8bit) *--------------------------------------------------*/ void printhex(byte i) { byte hi,lo; hi=i&0xF0; // High nibble hi=hi>>4; hi+='0'; if (hi>'9') hi+=7; lo=(i&0x0F)+'0'; // Low nibble if (lo>'9') lo=lo+7; lcd_putch(hi); lcd_putch(lo); }
/*-----------------31.5.99 18:18-------------------- * Display unsigned long 0-4294967296 (32bit) *--------------------------------------------------*/ void print10(unsigned long x) { unsigned int y; if (x<4294967297ul) { y=x/1000000000;lcd_putch(y+0x30);x-=(y*1000000000); y=x/100000000;lcd_putch(y+0x30);x-=(y*100000000); y=x/10000000;lcd_putch(y+0x30);x-=(y*10000000); y=x/1000000;lcd_putch(y+0x30);x-=(y*1000000); y=x/100000;lcd_putch(y+0x30);x-=(y*100000); y=x/10000;lcd_putch(y+0x30);x-=(y*10000); y=x/1000;lcd_putch(y+0x30);x-=(y*1000); y=x/100;lcd_putch(y+0x30);x-=(y*100); y=x/10;lcd_putch(y+0x30);x-=(y*10); lcd_putch(x+0x30); } else lcd_putstr("Err"); }
/*-----------------28.08.99 22:49------------------- * Simple printf function (no fp, and strings), * but it works for signed numbers *--------------------------------------------------*/ int printf(const char *format, ...) { static const char hex[] = "0123456789ABCDEF"; char format_flag; unsigned int u_val, div_val, base; char *ptr; va_list ap; va_start (ap, format); for (;;) { while ((format_flag = *format++) != '%') { if (!format_flag) { va_end (ap); return (0); } lcd_putch (format_flag); } switch (format_flag = *format++) { case 'c': format_flag = va_arg(ap,int); default: lcd_putch(format_flag); continue; case 'd': base = 10; div_val = 10000; goto CONVERSION_LOOP; case 'x': base = 16; div_val = 0x10; CONVERSION_LOOP: u_val = va_arg(ap,int); if (format_flag == 'd') { if (((int)u_val) < 0) { u_val = - u_val; lcd_putch ('-'); } while (div_val > 1 && div_val > u_val) div_val /= 10; } do { lcd_putch (hex[u_val / div_val]); u_val %= div_val; div_val /= base; } while (div_val); } } }
int main () { DDRD = 0x00; PORTD = 0xff; lcd_init (); /*display on, cursor & blink off */ lcd_control (1, 0, 0); timer1_init (); lcd_cls (); lcd_clear_CRGAM (); //az elso sorba irunk lcd_putstr ("Vertical", LCD_FIRST_LN_ADDR); /* main -loop */ for (;;) { if (cnt1 == CNT1_THRESHOLD) { cnt1 = 0; cnt3_flag = 1; //clear second line for (ch = 0; ch < 20; ch++) { lcd_set_DDRAM_addr (LCD_SECND_LN_ADDR + ch); lcd_putch (' '); } /* * array2d: custom chars array * ROWS: number of chars * 30: vertical delay in ms * 0: horiz. delay * LCD_FIRST_LN_ADDR + 9 : ddram addr. * 1: set CGRAM clear mode; 0: no CGRAM clear */ //nem clear modban erdekes hatast kelt ;-) lcd_vertical_scroll (array2d, ROWS, 40, 0 /* delay ms */ , LCD_FIRST_LN_ADDR + 9, 0); } if (cnt3 == CNT3_THRESHOLD) { cnt3 = 0; cnt3_flag = 0; lcd_putstr ("Is COOL!", LCD_SECND_LN_ADDR + 5); } } return 0; }
void scan_ex(void) { lcd_goto(0x40); char ad = 0x00; char test; char before_div; char dived_data[2]; lcd_goto(0x00); while(1) { test = getch(); data_div(test, dived_data); dived_data[0] = hex2char(dived_data[0]); dived_data[1] = hex2char(dived_data[1]); if(ad == 0x0F) ad = 0x40; else if(ad == 0x4F) ad = 0x00; else ad++; lcd_goto(ad); lcd_putch(dived_data[0]); if(ad == 0x0F) ad = 0x40; else if(ad == 0x4F) ad = 0x00; else ad++; lcd_goto(ad); lcd_putch(dived_data[1]); } }
void homem_inicio(void) { int a, b, c; a = 0; b = a + 1; c = a + 2; lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepA1); lcd_novo_char(1, stepA2); lcd_novo_char(2, stepA3); lcd_novo_char(3, stepA4); lcd_novo_char(4, stepA5); lcd_novo_char(5, stepA6); lcd_cursor_ddram(a, 1); lcd_putch(0); lcd_cursor_ddram(a, 0); lcd_putch(1); lcd_cursor_ddram(b, 1); lcd_putch(2); lcd_cursor_ddram(b, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); }
/*-----------------31.08.99 18:34------------------- * Display 0..65535 with or without leading zeroes * printdec(12345,6,'0') -> 012345 * printdec(12345,5,'') -> 12345 * printdec(12345,6,' ') -> 12345 *--------------------------------------------------*/ void printdec(unsigned int x, unsigned char n, unsigned char fillch) { unsigned char i; unsigned char s[10]; for (i = 0; i < n; i++) { s[n - i - 1] = '0' + (x % 10); x /= 10; } for (i=0; i<(n - 1); i++) { if (s[i] == '0') s[i] = fillch; else break; } for (i=0; i<n; i++) lcd_putch(s[i]); }
void lcd_tarih_goster(void) { char i; tarih[0] = rakam[(rdata[3]&0xF0) >> 4]; tarih[1] = rakam[ rdata[3]&0x0F]; tarih[3] = rakam[(rdata[4]&0xF0) >> 4]; tarih[4] = rakam[ rdata[4]&0x0F]; tarih[6] = rakam[(rdata[6]&0xF0) >> 4]; tarih[7] = rakam[ rdata[6]&0x0F]; tarih[8] = rakam[(rdata[5]&0xF0) >> 4]; tarih[9] = rakam[ rdata[5]&0x0F]; tarih[2]='/'; tarih[5]='/'; lcd_goto(1,12); for(i=0;i<5;i++) lcd_putch(tarih[i]); lcd_goto(2,13); lcd_puts("20"); for(i=6;i<8;i++) lcd_putch(tarih[i]); lcd_goto(2,1); switch(rdata[5]) { case 1 :lcd_puts("Pazartesi"); break; case 2 :lcd_puts("Sali "); break; case 3 :lcd_puts("Carsamba "); break; case 4 :lcd_puts("Persembe "); break; case 5 :lcd_puts("Cuma "); break; case 6 :lcd_puts("Cumartesi"); break; case 7 :lcd_puts("Pazar "); break; } }
void main(void) { int mesure=150; init(); // voir plus haut lcd_goto(0); //lcd d�but 1�re ligne sprintf(chaine,"%s","Valeur mesuree"); lcd_puts(chaine); mesure=mesure*1.236; lcd_goto(0x40); //lcd origine seconde ligne : 40h = 64d sprintf(chaine,"%4d",mesure); //affichage sur 4 digits en d�cimal lcd_puts(chaine); lcd_putch(' '); sprintf(chaine,"%s"," grammes"); lcd_puts(chaine); while (1){ } }
void lcd_saat_goster(void) { char i; saat[6] = rakam[(rdata[0]&0xF0) >> 4]; saat[7] = rakam[ rdata[0]&0x0F]; saat[3] = rakam[(rdata[1]&0xF0) >> 4]; saat[4] = rakam[ rdata[1]&0x0F]; saat[0] = rakam[(rdata[2]&0xF0) >> 4]; saat[1] = rakam[ rdata[2]&0x0F]; saat[2]=':'; saat[5]=':'; lcd_goto(1,1); for(i=0;i<8;i++) lcd_putch(saat[i]); }
int main(void) { ANSEL=0; ANSELH=0; CM1CON0=0; CM2CON0=0; TRISA=0; TRISC=0; lcd_init(); while (1==1) { lcd_clear(); pause(100); lcd_goto(0); pause(1); for (b0=0; b0<10; b0=b0+1) { lcd_putch( b0 + number ); pause(2); } lcd_goto(0x40); pause(2); _delay(4); __delay_us(1000); lcd_puts("Hello World"); pause(20); lcd_puts("_EOF"); pause(10); } return 0; }
int noinline debug_uart_put (char d, FILE *stream) { if (d == '\n') debug_uart_put('\r', stream); if (d == 0x1b) d = '^'; /* replace escape sequences. */ #ifdef S1D15G10_SUPPORT lcd_putch(d); #endif #ifdef SOFT_UART_SUPPORT soft_uart_putchar(d); return 0; #else while (!(usart(UCSR,A) & _BV(usart(UDRE)))); usart(UDR) = d; return 0; #endif }
void homem_corre_esquerda(void) { unsigned char a, b, c, d, e, f, g; for (a = 0; a < 11; a += 4) { b = a + 1; c = a + 2; d = a + 3; e = a + 4; f = a + 5; g = a + 6; lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepB1); lcd_novo_char(1, stepB2); lcd_novo_char(2, stepB3); lcd_novo_char(3, stepB4); lcd_novo_char(4, stepB5); lcd_novo_char(5, stepB6); lcd_cursor_ddram(b, 1); lcd_putch(0); lcd_cursor_ddram(b, 0); lcd_putch(1); lcd_cursor_ddram(c, 1); lcd_putch(2); lcd_cursor_ddram(c, 0); lcd_putch(3); lcd_cursor_ddram(d, 1); lcd_putch(4); lcd_cursor_ddram(d, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepC1); lcd_novo_char(1, stepC2); lcd_novo_char(2, stepC3); lcd_novo_char(3, stepC4); lcd_novo_char(4, stepC5); lcd_novo_char(5, stepC6); lcd_cursor_ddram(c, 1); lcd_putch(0); lcd_cursor_ddram(c, 0); lcd_putch(1); lcd_cursor_ddram(d, 1); lcd_putch(2); lcd_cursor_ddram(d, 0); lcd_putch(3); lcd_cursor_ddram(e, 1); lcd_putch(4); lcd_cursor_ddram(e, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepB1); lcd_novo_char(1, stepB2); lcd_novo_char(2, stepB3); lcd_novo_char(3, stepB4); lcd_novo_char(4, stepB5); lcd_novo_char(5, stepB6); lcd_cursor_ddram(d, 1); lcd_putch(0); lcd_cursor_ddram(d, 0); lcd_putch(1); lcd_cursor_ddram(e, 1); lcd_putch(2); lcd_cursor_ddram(e, 0); lcd_putch(3); lcd_cursor_ddram(f, 1); lcd_putch(4); lcd_cursor_ddram(f, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepD1); lcd_novo_char(1, stepD2); lcd_novo_char(2, stepD3); lcd_novo_char(3, stepD4); lcd_novo_char(4, stepD5); lcd_novo_char(5, stepD6); lcd_cursor_ddram(e, 1); lcd_putch(0); lcd_cursor_ddram(e, 0); lcd_putch(1); lcd_cursor_ddram(f, 1); lcd_putch(2); lcd_cursor_ddram(f, 0); lcd_putch(3); lcd_cursor_ddram(g, 1); lcd_putch(4); lcd_cursor_ddram(g, 0); lcd_putch(5); delay_ms(150); } }
void lcd_str(char *str) // Вывод строки на LCD в текущую позицию курсора { while(*str) lcd_putch(*str++); }
int main () { DDRD = 0x00; PORTD = 0xff; lcd_init (); /*display on, cursor & blink off */ lcd_control (1, 0, 0); lcd_cls (); lcd_putstr ("Animate is cool !", LCD_FIRST_LN_ADDR + 2); timer1_init (); /* main -loop */ for (;;) { // 2*0.065 Sec-kent vegrehajtodik az 1. es 3. animacio egy reszlete if (cnt1 == CNT1_THRESHOLD) { cnt1 = 0; //1. animacio if (i > 3) { i = 0; } uint8_t buf[8]; for (n = 0; n < 8; n++) { buf[n] = pgm_read_byte_near (&anim[i][n]); } i++; lcd_put_custom_char (0x00, buf); //CGRAM 0x00 cimre beirjuk a sajat karaktert. lcd_set_DDRAM_addr (LCD_FIRST_LN_ADDR); //vissza DDRAMhoz, elso sor 1 karakterehez lcd_putch (0x00); //megjelenitjuk a CGRAM 0x00 cimen levo karaktert. //2. animacio lcd_set_DDRAM_addr (LCD_FIRST_LN_ADDR + 19); //masodik sor 8. karakterehez lcd_putch (0x00); //megjelenitjuk a CGRAM 0x00 cimen levo karaktert. } // 7 * 0.065 Sec(OVF) -kent vegrehajtodik a 3. animacio egy reszlete if (cnt2 == CNT2_THRESHOLD) { cnt2 = 0; //3. animacio if (j > 1) { j = 0; } uint8_t buf[8]; //read 8byte(one char) from FLASH for (n = 0; n < 8; n++) { buf[n] = pgm_read_byte_near (&man[j][n]); } j++; lcd_put_custom_char (0x02, buf); lcd_set_DDRAM_addr (LCD_SECND_LN_ADDR); lcd_putch (0x02); } } return 0; }
/** * returns the number of character written to the buffer * not including the last '\0' */ int readFromUSBKeyboard(char* name, int length) { char buf[3]; char x; int count = 0; //LCD should be initialized already //Enable the cursor, and make it blinking. lcd_set_cursor_type(3); // will need an extra position reserved for the '\0' // input > 40 will wrap around the LCD buffer while (count < length && count < 32 && read(keyboard_fd, buf, 3)) { /* The third byte is the key-code, 'a' => 4, '1' => 30 * releasing a key sends a zero. */ if (x = buf[2]) { //assignment AND test if (x == 40 || x == 88) { //ENTER is 40 break; } else if (x == 42) { //BACKSPACE is 42 if (count > 0) { count--; ShiftCursor(0); lcd_putch(' '); ShiftCursor(0); } continue; } if (x >= 4 && x <= 4 + 26 - 1) { // 'a' to 'z' x = x - 4 + 'a'; } else if (x >= 30 && x <= 38) { // '1' to '9' x = x - 30 + '1'; } else if (x >= 89 && x <= 97) { // '1' to '9' x = x - 89 + '1'; } else if (x == 39 || x == 98) { // '0' x = '0'; } else if (x == 84) { x = '/'; } else if (x == 85) { x = '*'; } else if (x == 86) { x = '-'; } else if (x == 87) { x = '+'; } else if (x == 99) { x = '.'; } else { continue; } name[count++] = x; lcd_putch(x); fprintf(stderr, "%c, %d\n", x, x); } } name[count] = 0; //Disable the cursor. lcd_set_cursor_type(0); return count; }
void homem_vira_esquerda(void) { int a, b, c; a = 1; b = a + 1; c = a + 2; lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, slipD1); lcd_novo_char(1, slipD2); lcd_novo_char(2, slipD3); lcd_novo_char(3, slipD4); lcd_novo_char(4, slipD5); lcd_novo_char(5, slipD6); lcd_cursor_ddram(a, 1); lcd_putch(0); lcd_cursor_ddram(a, 0); lcd_putch(1); lcd_cursor_ddram(b, 1); lcd_putch(2); lcd_cursor_ddram(b, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, slipE1); lcd_novo_char(1, slipE2); lcd_novo_char(2, slipE3); lcd_novo_char(3, slipE4); lcd_novo_char(4, slipE5); lcd_novo_char(5, slipE6); lcd_cursor_ddram(a, 1); lcd_putch(0); lcd_cursor_ddram(a, 0); lcd_putch(1); lcd_cursor_ddram(b, 1); lcd_putch(2); lcd_cursor_ddram(b, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); delay_ms(150); lcd_novo_char(0, slipF1); lcd_novo_char(1, slipF2); lcd_novo_char(2, slipF3); lcd_novo_char(3, slipF4); lcd_novo_char(4, slipF5); lcd_novo_char(5, slipF6); lcd_cursor_ddram(a, 1); lcd_putch(0); lcd_cursor_ddram(a, 0); lcd_putch(1); lcd_cursor_ddram(b, 1); lcd_putch(2); lcd_cursor_ddram(b, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); delay_ms(150); }
void homem_corre_direita(void) { unsigned char a, b, c, d, e, f, g; for (a = 16; a > 4; a -= 4) { b = a - 1; c = a - 2; d = a - 3; e = a - 4; f = a - 5; g = a - 6; lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepE1); lcd_novo_char(1, stepE2); lcd_novo_char(2, stepE3); lcd_novo_char(3, stepE4); lcd_novo_char(4, stepE5); lcd_novo_char(5, stepE6); lcd_cursor_ddram(d, 1); lcd_putch(0); lcd_cursor_ddram(d, 0); lcd_putch(1); lcd_cursor_ddram(c, 1); lcd_putch(2); lcd_cursor_ddram(c, 0); lcd_putch(3); lcd_cursor_ddram(b, 1); lcd_putch(4); lcd_cursor_ddram(b, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepF1); lcd_novo_char(1, stepF2); lcd_novo_char(2, stepF3); lcd_novo_char(3, stepF4); lcd_novo_char(4, stepF5); lcd_novo_char(5, stepF6); lcd_cursor_ddram(e, 1); lcd_putch(0); lcd_cursor_ddram(e, 0); lcd_putch(1); lcd_cursor_ddram(d, 1); lcd_putch(2); lcd_cursor_ddram(d, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepE1); lcd_novo_char(1, stepE2); lcd_novo_char(2, stepE3); lcd_novo_char(3, stepE4); lcd_novo_char(4, stepE5); lcd_novo_char(5, stepE6); lcd_cursor_ddram(f, 1); lcd_putch(0); lcd_cursor_ddram(f, 0); lcd_putch(1); lcd_cursor_ddram(e, 1); lcd_putch(2); lcd_cursor_ddram(e, 0); lcd_putch(3); lcd_cursor_ddram(d, 1); lcd_putch(4); lcd_cursor_ddram(d, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, stepG1); lcd_novo_char(1, stepG2); lcd_novo_char(2, stepG3); lcd_novo_char(3, stepG4); lcd_novo_char(4, stepG5); lcd_novo_char(5, stepG6); lcd_cursor_ddram(g, 1); lcd_putch(0); lcd_cursor_ddram(g, 0); lcd_putch(1); lcd_cursor_ddram(f, 1); lcd_putch(2); lcd_cursor_ddram(f, 0); lcd_putch(3); lcd_cursor_ddram(e, 1); lcd_putch(4); lcd_cursor_ddram(e, 0); lcd_putch(5); delay_ms(150); } }
void homem_vira_direita(void) { int a = 13; int b = a + 1; int c = a + 2; lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, slipA1); lcd_novo_char(1, slipA2); lcd_novo_char(2, slipA3); lcd_novo_char(3, slipA4); lcd_novo_char(4, slipA5); lcd_novo_char(5, slipA6); lcd_cursor_ddram(a, 1); lcd_putch(0); lcd_cursor_ddram(a, 0); lcd_putch(1); lcd_cursor_ddram(b, 1); lcd_putch(2); lcd_cursor_ddram(b, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); delay_ms(150); lcd_clear(); lcd_string((char *) "----------------", LCD_LINHA3); lcd_novo_char(0, slipB1); lcd_novo_char(1, slipB2); lcd_novo_char(2, slipB3); lcd_novo_char(3, slipB4); lcd_novo_char(4, slipB5); lcd_novo_char(5, slipB6); lcd_cursor_ddram(a, 1); lcd_putch(0); lcd_cursor_ddram(a, 0); lcd_putch(1); lcd_cursor_ddram(b, 1); lcd_putch(2); lcd_cursor_ddram(b, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); delay_ms(150); lcd_novo_char(0, slipC1); lcd_novo_char(1, slipC2); lcd_novo_char(2, slipC3); lcd_novo_char(3, slipC4); lcd_novo_char(4, slipC5); lcd_novo_char(5, slipC6); lcd_cursor_ddram(a, 1); lcd_putch(0); lcd_cursor_ddram(a, 0); lcd_putch(1); lcd_cursor_ddram(b, 1); lcd_putch(2); lcd_cursor_ddram(b, 0); lcd_putch(3); lcd_cursor_ddram(c, 1); lcd_putch(4); lcd_cursor_ddram(c, 0); lcd_putch(5); delay_ms(150); }