![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Simple test for Version Control System
Revision 4:6a426b4967e5, committed 2017-05-24
- Comitter:
- alainpegatoquet
- Date:
- Wed May 24 12:48:18 2017 +0000
- Branch:
- Test_AnalogIn
- Parent:
- 3:083b8bb2bb8b
- Child:
- 5:08a6f7d7b7d0
- Commit message:
- Version 1.2 : const.h added
Changed in this revision
const.h | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 083b8bb2bb8b -r 6a426b4967e5 const.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/const.h Wed May 24 12:48:18 2017 +0000 @@ -0,0 +1,7 @@ +#ifndef CONST_H +#define CONST_H + +#define TEMPO1 0.5 +#define TEMPO2 1.0 + +#endif \ No newline at end of file
diff -r 083b8bb2bb8b -r 6a426b4967e5 main.cpp --- a/main.cpp Wed May 24 12:26:14 2017 +0000 +++ b/main.cpp Wed May 24 12:48:18 2017 +0000 @@ -1,18 +1,20 @@ #include "mbed.h" +#include "const.h" Serial pc(USBTX, USBRX); DigitalOut myled1(LED1); +DigitalOut myled1(LED2); AnalogIn Ain(p20); // Analog input int main() { float ADCdata; while(1) { myled1 = 1; - wait(0.5); + wait(TEMPO1); myled1 = 0; - wait(1.0); + wait(TEMPO2); ADCdata=Ain.read(); pc.printf("%f\t%fV \n\r",ADCdata, ADCdata*3.3); - wait(0.5); + wait(TEMPO1); } }