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:
- 1:c00ab08066b6
- Parent:
- 0:5797ba5402c6
--- a/main.cpp Thu Oct 05 07:37:23 2017 +0000
+++ b/main.cpp Thu Oct 05 07:38:57 2017 +0000
@@ -1,3 +1,7 @@
+// Divided Voltage ... Mechatronics example
+//
+// 2017.10.05 ... Y.Kuroda
+//
#include "mbed.h"
DigitalOut myled(LED1);
@@ -12,7 +16,7 @@
myled = !myled; // LED is toggled
float vo = a0.read()*vcc; // Vo (analog voltage)
- float vp = r2/(r1+f2) * vo;
+ float vp = r2/(r1+r2) * vo;
printf("Analog %7.1f [v]\n", vp);
}
}