Joel Manuel Fernandez Cuyubamba / Mbed 2 deprecated Partie6

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jomfec
Date:
Mon May 02 09:06:43 2016 +0000
Commit message:
INFO2

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	Mon May 02 09:06:43 2016 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+PwmOut moteur(p21);
+float intensite=0.0015;
+char c;
+
+int main() 
+{
+    moteur.period(0.020);
+    printf("Controle intensite de la Led\n");
+    
+
+    while(1) {
+        
+        printf("Pressez + ou - \n");
+        scanf("%c",&c);
+        
+        wait(0.001);
+        if((c == 'a') && (intensite < 0.002)) {
+            
+            intensite += 0.0001;
+            moteur.pulsewidth(intensite);
+        }
+        if((c == 'z') && (intensite > 0.001)) {
+            intensite -= 0.0001;
+            moteur.pulsewidth(intensite);
+        }
+        printf("%c %g \n ",c, intensite);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 02 09:06:43 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb
\ No newline at end of file