Kevin Sullivan / Mbed 2 deprecated lab2_2

Dependencies:   mbed C12832

Committer:
kevinsullivan
Date:
Tue Aug 04 10:10:44 2020 +0000
Revision:
4:59ea87bb5b80
Parent:
3:ace46fcebfd6
revised

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kevinsullivan 0:376219f61e79 1 #include "mbed.h"
kevinsullivan 0:376219f61e79 2 #include "C12832.h"
kevinsullivan 0:376219f61e79 3 Serial pc(USBTX, USBRX); // tx, rx
kevinsullivan 0:376219f61e79 4 PwmOut led1(LED1);
kevinsullivan 0:376219f61e79 5 AnalogIn pot1(p19);
kevinsullivan 0:376219f61e79 6 C12832 lcd(p5,p7,p6,p8,p11);
kevinsullivan 2:6bc37de37167 7
kevinsullivan 0:376219f61e79 8 int main()
kevinsullivan 0:376219f61e79 9 {
kevinsullivan 4:59ea87bb5b80 10 while(1) {
kevinsullivan 4:59ea87bb5b80 11 float volt_out = pot1;
kevinsullivan 4:59ea87bb5b80 12 led1 = pot1;
kevinsullivan 4:59ea87bb5b80 13 wait(0.01); // stabileise before taking reading
kevinsullivan 4:59ea87bb5b80 14 lcd.locate(0,0); //brings the cursor on the LCD back to the top left corner
kevinsullivan 4:59ea87bb5b80 15 lcd.printf("value = %.3fV\n",volt_out); // displays the voltage value on the LCD1 to 3 decimal places
kevinsullivan 4:59ea87bb5b80 16 lcd.printf("value = %.1eV\n",volt_out); // displays the voltage value on the LCD1 in scientific notation
kevinsullivan 4:59ea87bb5b80 17
kevinsullivan 0:376219f61e79 18 }
kevinsullivan 0:376219f61e79 19 }