Shigeki KOMATSU / Mbed 2 deprecated lpclcd_blink

Dependencies:   I2cLCD USBDevice mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // lpclcd LCD test program
00002 // 2013/11/3
00003 
00004 #include "mbed.h"
00005 #include "I2cLCD.h"
00006 #include "USBSerial.h"
00007  
00008 //Virtual serial port over USB
00009 USBSerial serial;
00010 // I2C LCD pin assignment
00011 I2cLCD lcd(p28, p27, p29); //sda scl reset
00012 
00013 DigitalOut myled(P1_6);
00014 DigitalOut backlight(P1_3);
00015 DigitalIn usersw(P0_1);
00016 
00017 long cn;
00018 
00019 int main() {
00020 
00021    backlight = 0;
00022    lcd.cls();
00023    lcd.printf("mbed lpclcd test");
00024    lcd.locate(0,1);
00025    lcd.printf("LPC11U24");
00026 
00027     cn = 0;
00028     while(1) {
00029         if (usersw == 1) {
00030            lcd.locate(0,1);
00031            lcd.printf("LPC11U24 %7d",cn++);        
00032         } else {
00033            lcd.locate(0,1);
00034            lcd.printf("lpc11u24 %7d",cn++);
00035         };
00036         serial.printf("Virtual Serial Port: LPC11U24 %7d\r\n",cn);
00037         myled = 1;
00038         wait(0.2);
00039         myled = 0;
00040         wait(0.2);
00041     }
00042 }