Gestion d'un potentiomètre avec bus CAN je crois

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Kemix
Date:
Wed Mar 11 09:22:41 2015 +0000
Commit message:
Le potard controle les LED;

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
diff -r 000000000000 -r 5d51daecce18 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 11 09:22:41 2015 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+int main(void){
+    
+    AnalogIn Pot(A0);
+    DigitalOut led1(LED1);
+    DigitalOut led2(LED2);
+    DigitalOut led3(LED3);
+    DigitalOut led4(LED4);   
+    
+    while(1){
+        led1 = (Pot > 0.2f) ? 1:0;   
+        led2 = (Pot > 0.4f) ? 1:0;
+        led3 = (Pot > 0.6f) ? 1:0;
+        led4 = (Pot > 0.8f) ? 1:0;
+    }
+    
+}
\ No newline at end of file
diff -r 000000000000 -r 5d51daecce18 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 11 09:22:41 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf
\ No newline at end of file