Home › Forums › Mayfly Data Logger › XBee Networks of Mayfly Loggers – 900Mhz › Reply To: XBee Networks of Mayfly Loggers – 900Mhz
Hello, I am new to using Mayflies and XBee modules, so I’m hoping I can get some help here since the modules I’m planning on using are the 900 MHz XBee Pro S3B. Programming the modules correctly in the XTCU is something I don’t entirely grasp, but for the moment I will focus on programming the Mayfly.
Right now I am just trying to get two Mayflies to send/receive temperature measurements from the Mayfly’s built-in temperature sensor. This first bit of code is for the Mayfly making the measurement and sending the data. The green LED (pin 8) is just so I can easily tell that the Mayfly is running the loop when I have it plugged into a wall.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
#include <Wire.h> #include "Sodaq_DS3231.h" void setup() { Serial1.begin(9600); Wire.begin(); rtc.begin(); } void loop() { digitalWrite(8, HIGH); rtc.convertTemperature(); Serial1.print(rtc.getTemperature()); Serial1.println(" deg C"); delay(1000); digitalWrite(8, LOW); delay(1000); } |
This next bit of code is for the Mayfly receiving the data and then printing it to the serial monitor so that I can verify that it is indeed receiving the data.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include <Wire.h> void setup() { Serial.begin(57600); Serial1.begin(9600); } void loop() { Serial.println(Serial1.read()); delay(250); } |
Right now my serial monitor just prints out a bunch of -1 values. Any help is appreciated. Thanks!