Przeglądaj źródła

fixed wrong offset when using 16x4 displays

pull/3/head
root 12 lat temu
rodzic
commit
b1b1dbe5ce
1 zmienionych plików z 10 dodań i 1 usunięć
  1. +10
    -1
      wiringPi/lcd.c

+ 10
- 1
wiringPi/lcd.c Wyświetl plik

@@ -180,9 +180,18 @@ void lcdClear (int fd)

void lcdPosition (int fd, int x, int y)
{
static uint8_t rowOff [4] = { 0x00, 0x40, 0x14, 0x54 } ;
static uint8_t rowOff [4] ;
struct lcdDataStruct *lcd = lcds [fd] ;

if (lcd->rows == 4 && lcd->cols == 16)
{
rowOff[0] = 0x00; rowOff[1] = 0x40; rowOff[2] = 0x10; rowOff[3] = 0x50;
}
else
{
rowOff[0] = 0x00; rowOff[1] = 0x40; rowOff[2] = 0x14; rowOff[3] = 0x54;
}

putCommand (lcd, x + (LCD_DGRAM | rowOff [y])) ;
}



Ładowanie…
Anuluj
Zapisz