Example program for LPC General Purpose Shield using the 128x64 LCD module

Dependencies:   ST7567 mbed

Committer:
MACRUM
Date:
Thu Jul 30 01:10:06 2015 +0000
Revision:
1:ef7d2db1e9db
Parent:
0:6a2e37a92150
Update library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MACRUM 0:6a2e37a92150 1 #include "mbed.h"
MACRUM 1:ef7d2db1e9db 2 #include "ST7567.h"
MACRUM 0:6a2e37a92150 3
MACRUM 1:ef7d2db1e9db 4 ST7567 lcd(D11, D13, D12, D9, D10); // mosi, sclk, reset, A0, nCS
MACRUM 0:6a2e37a92150 5
MACRUM 0:6a2e37a92150 6 int main()
MACRUM 0:6a2e37a92150 7 {
MACRUM 0:6a2e37a92150 8 int count=0;
MACRUM 0:6a2e37a92150 9 lcd.set_contrast(0x3f);
MACRUM 0:6a2e37a92150 10 lcd.cls();
MACRUM 0:6a2e37a92150 11
MACRUM 0:6a2e37a92150 12 lcd.locate(0, 1);
MACRUM 0:6a2e37a92150 13 lcd.printf("LPC General Purpose Shield");
MACRUM 0:6a2e37a92150 14 lcd.locate(0, 2 + 8);
MACRUM 0:6a2e37a92150 15 lcd.printf("[OM13082] test program");
MACRUM 0:6a2e37a92150 16
MACRUM 0:6a2e37a92150 17 lcd.rect(80, 20, 80+40, 20+40, 1);
MACRUM 0:6a2e37a92150 18 lcd.circle(20, 40, 20, 1);
MACRUM 0:6a2e37a92150 19
MACRUM 0:6a2e37a92150 20 while(true) { // this is the third thread
MACRUM 0:6a2e37a92150 21 lcd.locate(0, 3 + 24);
MACRUM 0:6a2e37a92150 22 lcd.printf("Counting : %d",count);
MACRUM 0:6a2e37a92150 23 count++;
MACRUM 0:6a2e37a92150 24 wait(1.0);
MACRUM 0:6a2e37a92150 25 }
MACRUM 0:6a2e37a92150 26 }