Potentiometer_3

Dependencies:   mbed C12832

Files at this revision

API Documentation at this revision

Comitter:
jforde
Date:
Tue Jul 28 11:46:47 2020 +0000
Parent:
0:a0ac0d5e438c
Commit message:
Potentiometer_3

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a0ac0d5e438c -r 73b0163fa7c4 main.cpp
--- a/main.cpp	Sat Jun 20 10:19:15 2020 +0000
+++ b/main.cpp	Tue Jul 28 11:46:47 2020 +0000
@@ -1,18 +1,19 @@
-#include"mbed.h"
+#include"mbed.h"                          //Preprocessor Directives //
 #include "C12832.h"
-C12832 lcd(p5, p7, p6, p8, p11);
+
+C12832 lcd(p5, p7, p6, p8, p11);             // Declarations //
 PwmOut led1(LED1);
 AnalogIn pot1(p19);
 
-int main()
+int main()                                 //instructions in main () function //
 {
     while(1) {
         led1 = pot1;
     lcd.locate (0,0);
-        lcd.printf("Potentiometer Value %.2f", pot1.read());
+        lcd.printf("Potentiometer Value %.2f", pot1.read()); //floating point print the first 2 digits after the point. 
         wait(0.01);
     lcd.locate (0,15);
-        lcd.printf("Potentiometer Value %.2e", pot1.read());
+        lcd.printf("Potentiometer Value %.2e", pot1.read()); //exponential point print the first 2 digits after the point.
         wait(0.01);
     }
 }