Quantcast
Channel: The Things Network - Latest posts
Viewing all articles
Browse latest Browse all 116440

Arduino with xbee shield + mDot

$
0
0

If you're using an Arduino Uno, then there is only one UART, which is shared between the USB port and the mDot. Easiest way to test functionality is to use a blank sketch (no Serial.begin) and just open the serial monitor (at 115200). If you type "AT", you should get an "OK" back from the mDot.

Your sketch above should work - almost! Change the Serial.print to Serial.println. Also, the sketch will probably run before your serial monitor gets connected, so maybe put a delay at the start.

If you have an Arduino Leonardo, then it has separate UART for the USB port and the mDot. In which case you'll need a sketch to pass characters back and forth between the two ports. Like this:

void setup()
{
Serial.begin(115200);
Serial1.begin(115200);
}

void loop()
{
if (Serial.available()) Serial1.write(Serial.read());
if (Serial1.available()) Serial.write(Serial1.read());
}


Viewing all articles
Browse latest Browse all 116440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>