Alain Pegatoquet
/
_er1_test_vcs
Programme de test pour LPC1768 (affichage de LED avec tempo)
Diff: main.cpp
- Revision:
- 2:48ae4b9e8cd8
- Parent:
- 1:9ef8f1f1261d
- Child:
- 4:36752a79e890
diff -r 9ef8f1f1261d -r 48ae4b9e8cd8 main.cpp --- a/main.cpp Mon Sep 04 16:39:47 2017 +0000 +++ b/main.cpp Tue Sep 05 06:57:10 2017 +0000 @@ -1,17 +1,16 @@ #include "mbed.h" -#include "const.h" - +Serial pc(USBTX, USBRX); DigitalOut myled(LED1); -DigitalOut myled1(LED2); +AnalogIn Ain(p20); // Analog input -int main() -{ +int main() { + float ADCdata; while(1) { - myled1 = 1; - myled2 = 0; - wait(TEMPO1); - myled1 = 0; - myled2 = 1; - wait(TEMPO2); + myled = 1; + wait(1.0); + myled = 0; + wait(1.0); + ADCdata=Ain.read(); + pc.printf("%f\t%fV \n\r",ADCdata, ADCdata*3.3); } }