Edutech IoT Team / Mbed 2 deprecated Eg7_LCD_printf

Dependencies:   C12832 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"     // Basic Library required for onchip peripherals
00002 #include "C12832.h"   // Library for SPI based LCD
00003  
00004 /* Create Objects */ 
00005 C12832 lcd(p5, p7, p6, p8, p11);    // Initialize lcd object with SPI pins
00006 
00007 /* Main Program */
00008 int main()
00009 {
00010     int j=0;
00011     
00012     lcd.cls();                 // Clear LCD Screen
00013     lcd.locate(0,3);           // Start from x=0 and y=3 pixels
00014     lcd.printf("mbed application board!"); // print string on LCD
00015     
00016     while(1)
00017     {
00018         lcd.locate(0,15);      // Start from x=0 and y=15 pixels
00019         lcd.printf("Counting : %d",j); // Display dynamic integer update
00020         j++;                   // increment j by 1
00021         wait(1.0);             // 1 sec delay
00022     }
00023 }