bleenisgrue
Member
Hi,
I want to send accelerometer data from one xbee connected to a teensy with sparkfun adapter, to another xbee connected to a macbook with a sparkfun explorer.
I didin't wired the sensor yet, firstly I just want to test communication between two xbees but it doesn't work.
Here are the units:
XTCU configuration of the agent(teensy)
XTCU configuration of the host(explorer)
I have read these two tutorials, one is the sparkfun's tutorial:
https://learn.sparkfun.com/tutorials/teensy-xbee-adapter-hookup-guide
I have tried the codes both uart and suart given in this tutorial.
Both units connected to computer through USB.
The code:
When this code is running, I type something to the teensy console, "DOUT" led blinks very weak and nothing is being delivered to xtcu console.(vice versa the same)
Another sparkfun tutorial:
https://learn.sparkfun.com/tutorials/exploring-xbees-and-xctu
In this tutorial, 2 xbees connected to computer with 2 explorers so 2 xbees showing up in XTCU software.
But it doesn't solved my problem because I have 1 explorer 1 adapter.
With this setup, how can I transmit accelerometer data from a standalone unit to computer?
before coming there, how can I simply send/receive serial messages?
any help, suggestion?
I want to send accelerometer data from one xbee connected to a teensy with sparkfun adapter, to another xbee connected to a macbook with a sparkfun explorer.
I didin't wired the sensor yet, firstly I just want to test communication between two xbees but it doesn't work.
Here are the units:
XTCU configuration of the agent(teensy)
XTCU configuration of the host(explorer)
I have read these two tutorials, one is the sparkfun's tutorial:
https://learn.sparkfun.com/tutorials/teensy-xbee-adapter-hookup-guide
I have tried the codes both uart and suart given in this tutorial.
Both units connected to computer through USB.
The code:
Code:
#include <AltSoftSerial.h>
//Serial test using the software uart on pins 20/21.
//Connect an XBee and Teensy 3.1 to the adapter board
//Connect an XBee to a serial terminal of your choice (USB dongle for example)
//
//Characters sent out the XBee terminal go:
// Onto the airwaves -> into S-UART RX -> out the serial monitor
//
//Characters sent out the serial monitor go:
// Out the S-UART TX pin -> onto the airwaves -> out the SBee serial terminal
//
//Be sure to select S-UART on the adapter board's switch for HW serial
AltSoftSerial altSerial;
void setup() {
// initialize serial communication at 9600 bits per second:
//Begin serial monitor port
Serial.begin(9600);
//Begin SW UART serial
altSerial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// Take data received from the serial monitor and pass it to the HW UART
if(Serial.available())
{
altSerial.print(Serial.read(), BYTE);
}
// Take data received from the HW UART and pass it to the serial monitor
if(altSerial.available())
{
Serial.print(altSerial.read(), BYTE);
}
//Wait to reduce serial load
delay(5);
}
Another sparkfun tutorial:
https://learn.sparkfun.com/tutorials/exploring-xbees-and-xctu
In this tutorial, 2 xbees connected to computer with 2 explorers so 2 xbees showing up in XTCU software.
But it doesn't solved my problem because I have 1 explorer 1 adapter.
With this setup, how can I transmit accelerometer data from a standalone unit to computer?
before coming there, how can I simply send/receive serial messages?
any help, suggestion?