35 lines
970 B
C++
35 lines
970 B
C++
/*
|
|
Check the new incoming messages, and print via serialin 115200 baud rate.
|
|
|
|
by Aaron.Lee from HelTec AutoMation, ChengDu, China
|
|
成都惠利特自动化科技有限公司
|
|
www.heltec.cn
|
|
|
|
this project also realess in GitHub:
|
|
https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series
|
|
*/
|
|
|
|
#include "heltec.h"
|
|
|
|
#define BAND 433E6 //you can set band here directly,e.g. 868E6,915E6
|
|
void setup() {
|
|
//WIFI Kit series V1 not support Vext control
|
|
Heltec.begin(true /*DisplayEnable Enable*/, true /*Heltec.LoRa Disable*/, true /*Serial Enable*/, true /*PABOOST Enable*/, BAND /*long BAND*/);
|
|
|
|
}
|
|
|
|
void loop() {
|
|
// try to parse packet
|
|
int packetSize = LoRa.parsePacket();
|
|
if (packetSize) {
|
|
// received a packet
|
|
Serial.print("Received packet '");
|
|
// read packet
|
|
while (LoRa.available()) {
|
|
Serial.print((char)LoRa.read());
|
|
}
|
|
// print RSSI of packet
|
|
Serial.print("' with RSSI ");
|
|
Serial.println(LoRa.packetRssi());
|
|
}
|
|
} |