Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sendTemperature() {
- radio.stopListening();
- radio.openWritingPipe(addresses[0]);
- String temperature = String(temp) + ".50";
- // FORMAT:
- // TMP= + temperature in format (00.00) + Node1
- // TMP=23.50Mastr
- String sendData = "TMP=" + temperature + nodeAddress;
- Serial.println("data to send: " + sendData);
- sendData.toCharArray(dataToSend, 32);
- radio.write(&dataToSend, sizeof(dataToSend));
- radio.startListening();
- memset(dataToSend, 0, sizeof(dataToSend));
- sendData = "";
- if (temp == 45) temp = 10;
- temp++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement