flexSensor + ledPWM + bluetooth

Dependencies:   Map

Revision:
0:5f93dfb618bf
Child:
1:0e180bcfcdae
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 19 05:41:58 2019 +0000
@@ -0,0 +1,18 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2018 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include "mbed.h"
+#include "Map.hpp"
+
+AnalogIn flexSensor(PA_7);
+Map map(0.9, 0.99999999, 0, 10000);
+int main() {
+    while (true) {
+        float analogValue = flexSensor;
+        
+        wait(0.5);
+        printf("%d\n", (int)map.Calculate(analogValue));
+    }
+}