if (!LoRa.begin(915E6)) { // initialize ratio at 915 MHz
Serial.println("LoRa init failed. Check your connections.");
while(true); //if failed, do nothing
}
if (!LoRa.begin(915E6)) { // initialize ratio at 915 MHz
Serial.println("LoRa init failed. Check your connections.");
while(true); //if failed, do nothing
}
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket(); // 수신된 데이터 크기를 packetSize에 저장
if (packetSize > 0) { //수신된 데이터가 존재 한다.
Serial.print("Received packet '");
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read()); //수신 데이터를 일어서 PC로 출력
}
// print RSSI of packet
Serial.print("' with RSSI ");
Serial.println(LoRa.packetRssi()); // 수신강도를 표시
}