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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:fcc5f3a4700c
diff -r 000000000000 -r fcc5f3a4700c main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jul 13 12:34:40 2021 +0000
@@ -0,0 +1,12 @@
+#include "mbed.h"
+
+AnalogIn p1(p19); //pot1
+
+int main() {
+ while(1) {
+ float p1_float = p1; // read pot1 value
+ float p1_volts = p1_float * 3.3; // convert analog value to voltage
+ printf("float: %f volts: %f \r\n",p1_float, p1_volts);
+ wait(3);
+ }
+}