File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
examples/LoraSendAndReceive Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ LoRaModem modem;
1111// Uncomment if using the Murata chip as a module
1212// LoRaModem modem(Serial1);
1313
14- #include " arduino_secrets.h"
14+ #include " arduino_secrets.h"
1515// Please enter your sensitive data in the Secret tab or arduino_secrets.h
1616String appEui = SECRET_APP_EUI;
1717String appKey = SECRET_APP_KEY;
@@ -76,15 +76,15 @@ void loop() {
7676 Serial.println (" No downlink message received at this time." );
7777 return ;
7878 }
79- String rcv;
80- rcv. reserve ( 64 ) ;
79+ char rcv[ 64 ] ;
80+ int i = 0 ;
8181 while (modem.available ()) {
82- rcv + = (char )modem.read ();
82+ rcv[i++] = (char )modem.read ();
8383 }
84- Serial.print (" Received: " + rcv + " - " );
85- for (unsigned int i = 0 ; i < rcv. length (); i ++) {
86- Serial.print (rcv[i ] >> 4 , HEX);
87- Serial.print (rcv[i ] & 0xF , HEX);
84+ Serial.print (" Received: " );
85+ for (unsigned int j = 0 ; j < i; j ++) {
86+ Serial.print (rcv[j ] >> 4 , HEX);
87+ Serial.print (rcv[j ] & 0xF , HEX);
8888 Serial.print (" " );
8989 }
9090 Serial.println ();
You can’t perform that action at this time.
0 commit comments