esp32:lora
Differences
This shows you the differences between two versions of the page.
| esp32:lora [2019/10/24 08:46] – created aistis | esp32:lora [2019/10/24 08:47] (current) – aistis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{: | {{: | ||
| + | |||
| + | < | ||
| + | /********* | ||
| + | Modified from the examples of the Arduino LoRa library | ||
| + | More resources: https:// | ||
| + | *********/ | ||
| + | |||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | //define the pins used by the transceiver module | ||
| + | #define ss 5 | ||
| + | #define rst 26 | ||
| + | //14 | ||
| + | #define dio0 2 | ||
| + | |||
| + | int counter = 0; | ||
| + | |||
| + | void setup() { | ||
| + | // | ||
| + | Serial.begin(115200); | ||
| + | while (!Serial); | ||
| + | Serial.println(" | ||
| + | |||
| + | //setup LoRa transceiver module | ||
| + | LoRa.setPins(ss, | ||
| + | | ||
| + | //replace the LoRa.begin(---E-) argument with your location' | ||
| + | //433E6 for Asia | ||
| + | //866E6 for Europe | ||
| + | //915E6 for North America | ||
| + | while (!LoRa.begin(868E6)) { | ||
| + | Serial.println(" | ||
| + | delay(500); | ||
| + | } | ||
| + | // Change sync word (0xF3) to match the receiver | ||
| + | // The sync word assures you don't get LoRa messages from other LoRa transceivers | ||
| + | // ranges from 0-0xFF | ||
| + | // | ||
| + | Serial.println(" | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | Serial.print(" | ||
| + | Serial.println(counter); | ||
| + | |||
| + | //Send LoRa packet to receiver | ||
| + | LoRa.beginPacket(); | ||
| + | LoRa.print(" | ||
| + | LoRa.print(counter); | ||
| + | LoRa.endPacket(); | ||
| + | |||
| + | counter++; | ||
| + | |||
| + | delay(1000); | ||
| + | } | ||
| + | |||
| + | </ | ||
esp32/lora.1571896019.txt.gz · Last modified: by aistis
