This is a simple demo which is the solution for Lab 2
Fork of app-shield-LCD by
main.cpp
- Committer:
- JimCarver
- Date:
- 2014-09-15
- Revision:
- 8:e95a2d548737
- Parent:
- 7:5c3616aaa642
File content as of revision 8:e95a2d548737:
#include "mbed.h"
#include "C12832.h"
// Using Arduino pin notation
C12832 lcd(D11, D13, D12, D7, D10);
AnalogIn pot1(A0);
AnalogIn pot2(A1);
PwmOut red(D5);
PwmOut green(D9);
int main()
{
int j=0;
float a1, a2;
red.period_ms(4);
green.period_ms(4);
lcd.cls();
lcd.locate(0,3);
lcd.printf("mbed application shield!");
while(true) { // this is the third thread
a1 = pot1.read();
a2 = pot2.read();
lcd.locate(0,15);
lcd.printf("POT1=%1.3f POT2=%1.3f",a1, a2);
red.write(a1);
green.write(a2);
j++;
wait(0.1);
}
}
