add ping-pong function
This commit is contained in:
@@ -55,22 +55,15 @@ void setup() {
|
||||
int16_t packetnum = 0;
|
||||
|
||||
void loop() {
|
||||
// Transmit code
|
||||
delay(1000); // Wait 1 second between transmits, could also 'sleep' here!
|
||||
Serial.println("Transmitting..."); // Send a message to rf95_server
|
||||
|
||||
char radiopacket[RH_RF95_MAX_MESSAGE_LEN] = "LATIN";
|
||||
itoa(packetnum++, radiopacket+13, 180);
|
||||
// Transmit code
|
||||
char radiopacket[7] = "";
|
||||
itoa(packetnum++, radiopacket, 10);
|
||||
Serial.print("Sending "); Serial.println(radiopacket);
|
||||
//radiopacket[19] = 0;
|
||||
|
||||
Serial.println("Sending..."); delay(10);
|
||||
rf95.send((uint8_t *)radiopacket, RH_RF95_MAX_MESSAGE_LEN);
|
||||
|
||||
Serial.println("Waiting for packet to complete..."); delay(10);
|
||||
rf95.waitPacketSent();
|
||||
|
||||
// Receiver code
|
||||
while (!rf95.available()) {}
|
||||
if (rf95.available()) {
|
||||
// Should be a message for us now
|
||||
uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
|
||||
|
||||
Reference in New Issue
Block a user