dc

Dependencies:   mbed nRF51822

main.cpp

Committer:
borlanic
Date:
2018-03-28
Revision:
1:aecce7b83157
Parent:
0:e97dc3733638

File content as of revision 1:aecce7b83157:

#include <cstdlib>
#include <mbed.h>
#include <math.h>


Serial pc(USBTX, USBRX); // tx, rx
Serial device(PA_0, PA_1);  // tx, rx
DigitalOut myled(LED1);

int main()
{

    device.baud(9600);
    //device.printf("ciao\n");
    pc.printf("cazzo\n");
    int i = 0;

    myled = 0;

    while(1) {
        char a = device.getc();

        int i = (int)a;
        if(i == 0) {
            myled = 0;
        }
        if(i == 1) {
            myled = 1;
        }
        pc.printf("%d\r\n",i);
        //device.printf("cazzo %d\r\n",i);
        //i++;
        wait(0.1);

    }
}