Showing use of printf on LCD

Dependencies:   C12832 mbed

main.cpp

Committer:
dwijaybane
Date:
2015-10-10
Revision:
1:5ec6783fbc31
Parent:
0:ee88f589f418

File content as of revision 1:5ec6783fbc31:

#include "mbed.h"     // Basic Library required for onchip peripherals
#include "C12832.h"   // Library for SPI based LCD
 
/* Create Objects */ 
C12832 lcd(p5, p7, p6, p8, p11);    // Initialize lcd object with SPI pins

/* Main Program */
int main()
{
    int j=0;
    
    lcd.cls();                 // Clear LCD Screen
    lcd.locate(0,3);           // Start from x=0 and y=3 pixels
    lcd.printf("mbed application board!"); // print string on LCD
    
    while(1)
    {
        lcd.locate(0,15);      // Start from x=0 and y=15 pixels
        lcd.printf("Counting : %d",j); // Display dynamic integer update
        j++;                   // increment j by 1
        wait(1.0);             // 1 sec delay
    }
}