123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include <M5Stack.h>
- #include <M5LoRa.h>
- void setup() {
- M5.begin();
- M5.Power.begin();
-
- LoRa.setPins();
- Serial.println("LoRa Sender");
- M5.Lcd.println("LoRa Sender");
-
- if (!LoRa.begin(433E6)) {
- Serial.println("Starting LoRa failed!");
- M5.Lcd.println("Starting LoRa failed!");
- while (1);
- }
-
- Serial.println("LoRa init succeeded.");
- M5.Lcd.println("LoRa init succeeded.");
- }
- void loop() {
-
- static uint32_t counter;
- Serial.print("Sending packet: ");
- Serial.println(counter);
-
- LoRa.beginPacket();
- LoRa.print("hello ");
- LoRa.print(counter);
- LoRa.endPacket();
- counter++;
- delay(1000);
- }
|