Home › Forums › Mayfly Data Logger › XBee Networks of Mayfly Loggers – 900Mhz › Reply To: XBee Networks of Mayfly Loggers – 900Mhz
2023-07-13 at 7:12 PM
#17976
For anyone who would be interested in using these radio modules with modular sensors, I was able to transfer modular sensor readings from a Mayfly through the XBee Pro S3B to another XBee Pro S3B in transparent mode using the following lines of code in my void loop() function:
1 2 3 4 5 |
digitalWrite(xbeeSleepPin, LOW); delay(100); dataLogger.printSensorDataCSV(&Serial1); delay(100); digitalWrite(xbeeSleepPin, HIGH); |
Here, dataLogger is just the Logger object. The xbeeSleepPin is 23. I also used the following lines of code in my setup() function:
1 2 3 4 5 6 7 |
// Setup XBee pinMode(xbeeRegulatorPin, OUTPUT); pinMode(xbeeSleepPin, OUTPUT); digitalWrite(xbeeRegulatorPin, HIGH); // Supply power to the XBee regulator Serial1.begin(xbeeBaud); // Begin UART-1 communication Wire.begin(); digitalWrite(xbeeSleepPin, HIGH); // Put XBee in sleep mode |
The xbeeRegulatorPin is 18, and the xbeeBaud is 9600.