WH1602B LCD library based on the HD44780 4-bit interface
Fork of TextLCD by
main.cpp@9:0a815952e22f, 2016-12-09 (annotated)
- Committer:
- mptapton
- Date:
- Fri Dec 09 12:21:23 2016 +0000
- Revision:
- 9:0a815952e22f
This code uses libraries created for 4-bit LCD's based on the HD44780. This ; program was designed for a similar product (Winstar's WH1602B 2x16 LC) working into an Mbed LPC1768. Pin allocation and wiring described in comments in main.cpp header
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mptapton | 9:0a815952e22f | 1 | #include "mbed.h" |
mptapton | 9:0a815952e22f | 2 | #include "TextLCD.h" |
mptapton | 9:0a815952e22f | 3 | |
mptapton | 9:0a815952e22f | 4 | /* This code uses libraries created for 4-bit LCD's based on the HD44780. This |
mptapton | 9:0a815952e22f | 5 | program was designed for a similar product (Winstar's WH1602B 2x16 LC) working |
mptapton | 9:0a815952e22f | 6 | into an Mbed LPC1768. |
mptapton | 9:0a815952e22f | 7 | LCD pins: Pin 1(VSS) to Mbed Gnd, Pin 2(VDD) to Mbed VOUT, Pin 3(Vo- contrast) |
mptapton | 9:0a815952e22f | 8 | to Mbed Gnd, Pin 5(R/W) to Mbed Gnd, Pin 15(A)to Mbed VOUT, Pin 16(B) to |
mptapton | 9:0a815952e22f | 9 | MBed Gnd, Pins 4(RS),20(E) and the 4 data bits (DB4 [11] through to DB7 [14]) |
mptapton | 9:0a815952e22f | 10 | go to the Mbed pins described below: */ |
mptapton | 9:0a815952e22f | 11 | |
mptapton | 9:0a815952e22f | 12 | TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d4-d7 |
mptapton | 9:0a815952e22f | 13 | |
mptapton | 9:0a815952e22f | 14 | int main() { |
mptapton | 9:0a815952e22f | 15 | lcd.printf("Hello World!\n"); |
mptapton | 9:0a815952e22f | 16 | wait (1); |
mptapton | 9:0a815952e22f | 17 | lcd.printf("Test Message\n"); |
mptapton | 9:0a815952e22f | 18 | wait (1); |
mptapton | 9:0a815952e22f | 19 | lcd.cls(); |
mptapton | 9:0a815952e22f | 20 | lcd.printf("Test OK\n"); |
mptapton | 9:0a815952e22f | 21 | } |
mptapton | 9:0a815952e22f | 22 | |
mptapton | 9:0a815952e22f | 23 |