David Mc Sherry / Mbed 2 deprecated INS_LAB_Q2

Dependencies:   mbed C12832

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" // LCD on Mbed
00003 
00004 PwmOut led1 (LED1); // Control the brightness of LED1
00005 AnalogIn pot1 (p19);    //Used to change brightness 
00006 C12832 lcd(p5, p7, p6, p8, p11);    // Register the pins needed for LCD
00007 
00008 int main()
00009 {
00010     
00011     while(1) { 
00012     led1 = pot1;    // LED1 the same value as POT1
00013     lcd.locate(0,0);    // Area on LCD to start text
00014     lcd.printf("Potentiometer value 1 = %.2f", pot1.read());
00015     
00016     lcd.locate(0,10);
00017     lcd.printf("Potentiometer value 2 = %.2e", pot1.read());
00018     
00019     wait(0.5);
00020     }
00021 }