Jim Carver / Mbed 2 deprecated app-shield-EBV

Dependencies:   C12832 mbed

Fork of app-shield-LCD by Chris Styles

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "C12832.h"
00003 
00004 // Using Arduino pin notation
00005 C12832 lcd(D11, D13, D12, D7, D10);
00006 AnalogIn pot1(A0);
00007 AnalogIn pot2(A1);
00008 PwmOut red(D5);
00009 PwmOut green(D9);
00010 
00011 
00012 
00013 int main()
00014 {
00015     int j=0;
00016     float a1, a2;
00017     red.period_ms(4);
00018     green.period_ms(4);
00019     lcd.cls();
00020     lcd.locate(0,3);
00021     lcd.printf("mbed application shield!");
00022 
00023     while(true) {   // this is the third thread
00024         a1 = pot1.read();
00025         a2 = pot2.read();
00026         lcd.locate(0,15);
00027         lcd.printf("POT1=%1.3f POT2=%1.3f",a1, a2);
00028         red.write(a1);
00029         green.write(a2);
00030         j++;
00031         wait(0.1);
00032     }
00033 }