Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
- Committer:
- poehalcho
- Date:
- 2015-04-23
- Revision:
- 0:3ca0cae21204
File content as of revision 0:3ca0cae21204:
#include "mbed.h"
Serial xbee1(PA_9, PA_10); //was PA_2, PA_3
DigitalOut rst1(PA_11);
DigitalOut myled(LED1);
DigitalIn mybutton(USER_BUTTON);
int main() {
    rst1 = 0;   //Set reset pin to 0
    myled = 0;
    wait_ms(1);
    rst1 = 1;   //Set reset pin to 1
    wait_ms(1);
    wait(2);
    while (1) {
        if(xbee1.readable()){
            int a = 0;
            a = xbee1.getc(); //XBee read
                        
            if (a == 5){
                myled = 1; //blink spastically
                wait(0.2);
                myled = 0;
                wait(0.2);
            }
            if (a == 10){
                myled = 1;
                wait(3);
                myled = 0;
            }
        }
    }
}