Timothé Turko / Mbed 2 deprecated Nucleo_read_analog_value

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
turko
Date:
Wed Nov 18 21:15:41 2020 +0000
Commit message:
test

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	Wed Nov 18 21:15:41 2020 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+
+DigitalOut myLED1(A1);
+DigitalOut myLED2(A2);
+DigitalOut myLED3(A3);
+DigitalOut myLED4(A4); 
+
+AnalogIn analog_value(A0);
+
+float r;
+
+int main() {
+    
+    
+    
+    while(1){
+
+    r=100*analog_value.read();
+
+        if (r>0){
+            
+            myLED1 = 1;
+            if (r>25){
+            
+                myLED2 = 1;
+                if (r>50){
+            
+                    myLED3 = 1;
+                    if (r>0){
+            
+                        myLED4 = 1;
+                    
+                    }
+                
+                }
+            
+            }
+        
+        }
+        
+        
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 18 21:15:41 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file