Sonar_Beacon

Dependencies:   mbed RF12B

main.cpp

Committer:
xiaxia686
Date:
2012-03-21
Revision:
0:bc5045987df8

File content as of revision 0:bc5045987df8:

#include "mbed.h"
#include "RF12B.h"
//#include "SRF05.h"
#define CODE 0x88

DigitalOut Led_1(LED1);
DigitalOut trigger(p13);

Serial pc(USBTX, USBRX); // tx, rx

RF12B RF_Beacon(p5,p6,p7,p8,p9);

char data_in;

int main() {
    pc.printf("Beacon Side \n");
    while (1) {
        data_in=RF_Beacon.read();
        if (data_in == (char) CODE) {
            Led_1 = 1;
            trigger = 1;
            wait_us(10);
            trigger = 0;
            pc.printf("%x \n",data_in);
            Led_1 = 0;

        }

    }
}