view history edit print login register

LCD displays

Troubleshooting

  • LCD display is too dark or too pale. All LCDs have a contrast setting, whether it is available to you for adjustment or not. Many have backlights. The latter parts of the guide to using an external serial controller address these issues in general terms, mostly independently of controller issues.

Printing Numbers

The itoa() stdlib C library function can be used to convert a number into a string, in a variety of bases (e.g. decimal, binary). The buffer must be large enough to hold the largest number, plus sign and terminating null: e.g. 32 bit base-10: "-2147483648\0" = 12 characters.

The stdlib itoa() library routine adds around 600 bytes, the roll-your-own K&R implementation, which includes string.h, adds around 670 bytes. Using snprintf() from stdio.h adds just over 2200 bytes.

e.g.

char buf[12]; // "-2147483648\0"
lcd.printIn(itoa(random(1024)-512, buf, 10));


Page maintenance:

  • would an admin please
    • delete the attachment "LCD4BitLibrary", but KEEP LCD4BitLibrary.zip
    • delete the page Code.LCD4Bit