Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
BertieHarte
Date:
Fri Mar 26 10:17:07 2021 +0000
Commit message:
make public

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Mar 26 10:17:07 2021 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+// Initializes a pin to perform analog input and digital outpuut functions
+AnalogIn aInput(p19) // pot 1 on the application board
+DigitalOut dOutput(LED1);
+
+int main(void) {
+    while(1) {
+        //test the voltage on the initialized analog pin
+        // if greater than 0.3 * VCC set the digital pin
+        // to a logic 1 otherwise set to logic 0
+        if (aInput > 0.3f) {
+            dOutput = 1;
+            } else {
+                dOutput = 0;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Mar 26 10:17:07 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file