help
/
Info_2_TD
Diff: Partie_6/Exercice_1.cpp
- Revision:
- 0:4651c5d6ca1e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Partie_6/Exercice_1.cpp Thu Jun 25 16:30:18 2020 +0000 @@ -0,0 +1,22 @@ +/*#include "mbed.h" +Serial pc(USBTX, USBRX); +PwmOut Led(LED1); +float intensite=0.0; +int main() +{ + pc.printf("Contrôle de l’intensité de la Led\n\r"); + pc.printf("Pressez ‘+’ ou ‘-’\n\r"); + while(1) { + char c = pc.getc(); + wait(0.001); + if((c == '+') && (intensite < 0.1)) { + intensite += 0.001; + Led.write(intensite); + } + if((c == '-') && (intensite > 0.0)) { + intensite-= 0.001; + Led.write(intensite); + } + pc.printf("%c %1.3f\n\r",c, intensite); + } +}*/ \ No newline at end of file