Connect Wi-Fi

Dependencies:   mbed

main.cpp

Committer:
chanagan2540
Date:
2017-12-08
Revision:
0:3c8c53e45689
Child:
1:c0fbff97b740

File content as of revision 0:3c8c53e45689:

#include "mbed.h"
 
Serial esp(D8, D2);
Serial pc(D1, D0);

void wifi() {
    uint8_t data;
    
    while(1) {
        if(esp.readable()) {
            data = esp.getc();   
            pc.printf("Data = %d \n",data);
        }
        else {
            pc.printf("Error!! \n");
        }
        break;
    }
    
}

int main() {
    pc.printf("Hello!! \n");
    wifi();
}