serial transmit actually working

This commit is contained in:
2025-02-08 20:59:49 -05:00
parent 223a5270e7
commit 3bc36b2ba8

View File

@@ -59,12 +59,13 @@ const byte numChars = RH_RF95_MAX_MESSAGE_LEN;
char receivedChars[numChars];
void loop() {
strcpy(receivedChars, "");
memset(receivedChars, '\0', sizeof(receivedChars));
int dataReceived = 0;
int ndx = 0;
while (Serial.available() > 0) {
dataReceived = 1;
static byte ndx = 0;
// read the incoming byte:
incomingByte = Serial.read();
// say what you got:
@@ -74,13 +75,13 @@ void loop() {
if (dataReceived) {
dataReceived = 0;
Serial.print("I received: ");
Serial.println(receivedChars);
Serial.print("Trying to send: ");
Serial.print(receivedChars);
// Transmit code
Serial.println("Transmitting..."); // Send a message to rf95_server
// Serial.println("Transmitting..."); // Send a message to rf95_server
Serial.print("Sending "); Serial.println(receivedChars);
// Serial.print("Sending "); Serial.println(receivedChars);
// Serial.println("Sending..."); delay(10);
rf95.send((uint8_t *)receivedChars, RH_RF95_MAX_MESSAGE_LEN);