Harriet Noons
/
wifisend
wifisend code
main.cpp@0:43a44591e916, 2013-05-02 (annotated)
- Committer:
- hnoons
- Date:
- Thu May 02 10:22:44 2013 +0000
- Revision:
- 0:43a44591e916
wifi send before tag
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hnoons | 0:43a44591e916 | 1 | #include "mbed.h" |
hnoons | 0:43a44591e916 | 2 | #include "main.h" |
hnoons | 0:43a44591e916 | 3 | |
hnoons | 0:43a44591e916 | 4 | Serial xbee1(PTC4, PTC3); |
hnoons | 0:43a44591e916 | 5 | Serial pc(USBTX, USBRX); |
hnoons | 0:43a44591e916 | 6 | DigitalOut rst1(PTC5); |
hnoons | 0:43a44591e916 | 7 | |
hnoons | 0:43a44591e916 | 8 | DigitalOut myled(LED1); |
hnoons | 0:43a44591e916 | 9 | DigitalOut myled2(LED2); |
hnoons | 0:43a44591e916 | 10 | DigitalOut myled3(LED3); |
hnoons | 0:43a44591e916 | 11 | |
hnoons | 0:43a44591e916 | 12 | int main() { |
hnoons | 0:43a44591e916 | 13 | rst1 = 0; //Set reset pin to 0 |
hnoons | 0:43a44591e916 | 14 | myled = 0; |
hnoons | 0:43a44591e916 | 15 | myled2= 0; |
hnoons | 0:43a44591e916 | 16 | wait_ms(1); |
hnoons | 0:43a44591e916 | 17 | rst1 = 1; //Set reset pin to 1 |
hnoons | 0:43a44591e916 | 18 | wait_ms(1); |
hnoons | 0:43a44591e916 | 19 | |
hnoons | 0:43a44591e916 | 20 | while (1) { |
hnoons | 0:43a44591e916 | 21 | |
hnoons | 0:43a44591e916 | 22 | pc.getc(); //function to write data to send -- change for TAG ID'r |
hnoons | 0:43a44591e916 | 23 | |
hnoons | 0:43a44591e916 | 24 | xbee1.putc(pc.getc()); //XBee write |
hnoons | 0:43a44591e916 | 25 | myled3 = 0; |
hnoons | 0:43a44591e916 | 26 | myled2=1; |
hnoons | 0:43a44591e916 | 27 | myled=1; |
hnoons | 0:43a44591e916 | 28 | } |
hnoons | 0:43a44591e916 | 29 | } |
hnoons | 0:43a44591e916 | 30 | |
hnoons | 0:43a44591e916 | 31 |