1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| // https://www.lextronic.fr/lextronic_doc/ELCD.pdf
// Page 7 et suivantes
byte loopCounter = 0;
void setup(void)
{
Serial.begin(19200);
delay(500);
lcd204blbCls();
lcd204blbText("Hello");
lcd204blbColRow(7, 1);
lcd204blbText("Emirhan");
}
void loop()
{
lcd204blbColRow(2, 1);
lcd204blbText(String(loopCounter) + " ");
delay(500);
loopCounter ++;
}
void lcd204blbText(String lcdText)
{
Serial.write(0xA2);
for (int i = 0; i < lcdText.length(); i++)
{
Serial.write(lcdText.charAt(i));
}
Serial.write(0x00);
delay(200);
}
void lcd204blbCls()
{
Serial.write(0xA3);
Serial.write(0x01);
delay(200);
}
void lcd204blbColRow(byte lcdCol, byte lcdRow)
{
Serial.write(0xA1);
Serial.write(lcdCol);
Serial.write(lcdRow);
delay(200);
} |