Code APP3

Dependencies:   mbed EthernetInterface WebSocketClient mbed-rtos BufferedSerial

Fork of APP3_Lab by Jean-Philippe Fournier

main.cpp

Committer:
Cheroukee
Date:
2017-09-27
Revision:
1:ea1b52d0a8a3
Parent:
0:f468a460723d
Child:
2:a9bb12eefc08

File content as of revision 1:ea1b52d0a8a3:

#include "mbed.h"
    
#include "xbee.h"
    
#define PAN_ID 0xC0FFEE
    
    
Serial pc(USBTX, USBRX); // tx, rx

int main() {
    
    xbee_init();
    
    char c;
    
    char hello_world[12] = "Hello world";
    
    transmit_request(hello_world, 11);
    
    while(1) {
        if (pc.readable())
        {     
            c = pc.getc();
            xbee.putc(c);      
            //pc.putc(c);         
        }
        if (xbee.readable())
        {
            pc.putc(xbee.getc());            
        }       
    }
}