Testing stuff

Dependencies:   mbed

main.cpp

Committer:
gvela024
Date:
2018-06-15
Revision:
0:f95a24befabd

File content as of revision 0:f95a24befabd:

#include "mbed.h"

DigitalOut myled(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);

AnalogIn adc(P0_26);
Serial serial(P0_0, P0_1, 19200);

int main() {
    
    
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
        
        serial.printf("%5d\n\r", adc.read_u16());
        if(adc.read_u16() > (0xFFFF / 2))
           {
              led2 = 1;
              led3 = 0;
           }
           else
           {
              led2 = 0;
              led3 = 1;
           }
    }
}