Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years ago.
L053R8 Use Pins D8 and D2 With xbee sheild and xbee pro
Not sure if Hardware or software issue
Attempting one way transmission aiming for bi directional transmission.
For the hardware how should the shunts be mounted for both transmitter and reciever
for the coding side would anything prevent the receiver from activating
Any help is appreciated
- include "mbed.h"
- include "xbee.h"
xbee xbee1(D8,D2,D5); DigitalIn mybutton(USER_BUTTON); DigitalOut myled(LED1);
int main() { char send_data[202];
while(1) { if (mybutton == 0) { Button is pressed myled = !myled; Toggle the LED state send_data[0] = myled; xbee1.SendData(send_data); wait(0.4); 200 ms }
if (mybutton == 1) { Button isn't pressed myled = 0; Toggle the LED state send_data[1] = myled; xbee1.SendData("0"); } } }
for the Receiver
- include "mbed.h"
- include "xbee.h"
xbee xbee1(D8,D2,D5); DigitalIn mybutton(USER_BUTTON); DigitalOut myled(LED1);
int main() { char read_data[202];
while(1) { xbee1.RecieveData(read_data,1); myled = read_data[0]; } }
Thanks in advance Any help is appreciated