![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Programme de test pour LPC1768 (affichage de LED avec tempo)
Diff: main.cpp
- Revision:
- 4:36752a79e890
- Parent:
- 3:412b0e9270ee
- Parent:
- 2:48ae4b9e8cd8
--- a/main.cpp Wed Sep 06 06:54:18 2017 +0000 +++ b/main.cpp Wed Sep 06 07:26:53 2017 +0000 @@ -1,17 +1,19 @@ #include "mbed.h" -#include "const.h" - +Serial pc(USBTX, USBRX); DigitalOut myled(LED1); DigitalOut myled1(LED3); +AnalogIn Ain(p20); // Analog input -int main() -{ +int main() { + float ADCdata; while(1) { + myled = 1; + myled1 = 0; + wait(1.0); + myled = 0; myled1 = 1; - myled2 = 0; - wait(TEMPO1); - myled1 = 0; - myled2 = 1; - wait(TEMPO2); + wait(1.0); + ADCdata=Ain.read(); + pc.printf("%f\t%fV \n\r",ADCdata, ADCdata*3.3); } }