mbed LPC1768 and LCD example

In this example we connect an LCD to our mbed LPC1768 and display some text on it, we use a library to do most of the hard work here so our development is made easy by the TEXT LCD library.

The schematic shows how to connect up the 16×2 LCD to the mbed LPC1768

 

Schematic

mbed and lcd schematic
mbed and lcd schematic

Code

 

 

[codesyntax lang=”cpp”]

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD16x2); // rs, e, d4-d7

int main() {
lcd.printf("Hello World!\n");
}

[/codesyntax]

 

 

Share
This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views :