teste

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut myled(LED_RED);
00004 Timer M1;
00005 AnalogIn ain(PTC2);
00006 
00007 int main() {
00008     
00009     while(1) {
00010         M1.start();
00011         myled = 1;
00012         printf("Entrada do AD:%f\n",ain.read());  
00013         myled = 0;
00014         M1.stop();
00015         printf("O tempo gasto foi de %f segundos\n", M1.read());
00016     }
00017 }