Joel Manuel Fernandez Cuyubamba
/
Partie6
main.cpp
- Committer:
- jomfec
- Date:
- 2016-05-02
- Revision:
- 0:a7dc731f6246
File content as of revision 0:a7dc731f6246:
#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); } }