< Strong>Аппаратное обеспечение:
- TTGO T-Display ESP32 с LoRa
- Использование Arduino IDE 2.x
- Версия библиотеки LoRa: 0.8.0
// Minimal reproducible example
#include
#include
#define LORA_SCK 5
#define LORA_MISO 19
#define LORA_MOSI 27
#define LORA_CS 18
#define LORA_RST 23
#define LORA_IRQ 26
#define LORA_FREQ 868E6
void setup() {
Serial.begin(115200);
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
LoRa.setPins(LORA_CS, LORA_RST, LORA_IRQ);
if (!LoRa.begin(LORA_FREQ)) {
Serial.println("LoRa failed!");
while (1);
}
LoRa.setTxPower(14);
LoRa.setSpreadingFactor(7);
LoRa.setSignalBandwidth(125E3);
}
void loop() {
if (!LoRa.beginPacket()) {
Serial.println("Begin failed");
return;
}
LoRa.print("TEST");
bool success = LoRa.endPacket(); //
Подробнее здесь: https://stackoverflow.com/questions/793 ... g-messages
Мобильная версия