Skip to content

Commit d605485

Browse files
committed
Fix DumbModemLoraSender example to work with arduino-LoRa 0.5.0
1 parent 4b1b977 commit d605485

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/DumbModemLoraSender/DumbModemLoraSender.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@
55
*
66
* The example is based on LoraSender by @sandeepmistry arduino-LoRa library
77
* https://github.com/sandeepmistry/arduino-LoRa
8+
*
9+
* Starting from https://github.com/sandeepmistry/arduino-LoRa/commit/5f62ed2ce9d1623bfc12f468b8152ba1878b5b16,
10+
* LoRa library knows about MKRWAN1300 and automatically restarts the module in dumb mode, uses SPI1 and the correct gpios.
811
*
912
* Since there is no IRQ pin available the host must poll for data (unfortunately)
1013
*
1114
*/
1215

1316
#include <SPI.h>
1417
#include <LoRa.h>
15-
#include <MKRWAN.h>
18+
//#include <MKRWAN.h>
1619

1720
int counter = 0;
1821

19-
LoRaModem modem;
22+
//LoRaModem modem;
2023

2124
void setup() {
2225
Serial.begin(9600);
2326
while (!Serial);
2427

25-
modem.dumb();
28+
// No need to call modem.dumb() with arduino-LoRa >= 0.5.0
29+
//modem.dumb();
2630

2731
Serial.println("LoRa Sender");
2832

29-
// override the default CS, reset, and IRQ pins (optional)
30-
LoRa.setPins(LORA_IRQ_DUMB, 6, 1); // set CS, reset, IRQ pin
31-
LoRa.setSPIFrequency(100000);
32-
33-
if (!LoRa.begin(SPI1, 915E6)) {
33+
if (!LoRa.begin(915E6)) {
3434
Serial.println("Starting LoRa failed!");
3535
while (1);
3636
}

0 commit comments

Comments
 (0)