Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 5:49651a9f8ff7
- Parent:
- 4:4b62680f91b5
- Child:
- 6:204c63ac705d
- Child:
- 7:54c528b47ea7
--- a/main.cpp Tue Jun 05 11:51:48 2018 +0000
+++ b/main.cpp Tue Jun 05 13:00:52 2018 +0000
@@ -3,19 +3,20 @@
#include <string>
#include <iostream>
-int main() {
-
- DigitalOut myled(LED1);
- DigitalOut myled2(LED2);
- AnalogIn Ain (p20);
- TextLCD lcd (p22, p21, p23,p24,p25,p26);
+DigitalOut myled(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
+AnalogIn Ain(p20);
+TextLCD lcd(p22, p21, p23, p24, p25, p26);
- while(1){
- float f = Ain.read();
- float Vin = f *3.3;
- lcd.printf("%.2f", Vin);
- //myled=1;
-
- }
-
+int main() {
+ while(1){
+ float f = Ain.read(); //Read voltage value
+ float Vin = f *3.3;
+ lcd.printf("%.2f", Vin);
+ lcd.printf("\n");
+ //myled=1;
+
+ }
}
