readme
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
#include <RadioHead.h>
|
||||||
|
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <RH_RF95.h>
|
#include <RH_RF95.h>
|
||||||
|
|
||||||
@@ -19,7 +21,7 @@ void setup() {
|
|||||||
digitalWrite(RFM95_RST, HIGH);
|
digitalWrite(RFM95_RST, HIGH);
|
||||||
|
|
||||||
// while (!Serial); // wait until serial console is open, remove if not tethered to computer
|
// while (!Serial); // wait until serial console is open, remove if not tethered to computer
|
||||||
Serial.begin(9600);
|
Serial.begin(115200);
|
||||||
delay(100);
|
delay(100);
|
||||||
Serial.println("Feather LoRa RX Test!");
|
Serial.println("Feather LoRa RX Test!");
|
||||||
|
|
||||||
@@ -57,13 +59,13 @@ void loop() {
|
|||||||
delay(1000); // Wait 1 second between transmits, could also 'sleep' here!
|
delay(1000); // Wait 1 second between transmits, could also 'sleep' here!
|
||||||
Serial.println("Transmitting..."); // Send a message to rf95_server
|
Serial.println("Transmitting..."); // Send a message to rf95_server
|
||||||
|
|
||||||
char radiopacket[20] = "Hello World # ";
|
char radiopacket[RH_RF95_MAX_MESSAGE_LEN] = "LATIN";
|
||||||
itoa(packetnum++, radiopacket+13, 10);
|
itoa(packetnum++, radiopacket+13, 180);
|
||||||
Serial.print("Sending "); Serial.println(radiopacket);
|
Serial.print("Sending "); Serial.println(radiopacket);
|
||||||
radiopacket[19] = 0;
|
//radiopacket[19] = 0;
|
||||||
|
|
||||||
Serial.println("Sending..."); delay(10);
|
Serial.println("Sending..."); delay(10);
|
||||||
rf95.send((uint8_t *)radiopacket, 20);
|
rf95.send((uint8_t *)radiopacket, RH_RF95_MAX_MESSAGE_LEN);
|
||||||
|
|
||||||
Serial.println("Waiting for packet to complete..."); delay(10);
|
Serial.println("Waiting for packet to complete..."); delay(10);
|
||||||
rf95.waitPacketSent();
|
rf95.waitPacketSent();
|
||||||
@@ -76,7 +78,7 @@ void loop() {
|
|||||||
|
|
||||||
if (rf95.recv(buf, &len)) {
|
if (rf95.recv(buf, &len)) {
|
||||||
digitalWrite(LED_BUILTIN, HIGH);
|
digitalWrite(LED_BUILTIN, HIGH);
|
||||||
RH_RF95::printBuffer("Received: ", buf, len);
|
//RH_RF95::printBuffer("Received: ", buf, len);
|
||||||
Serial.print("Got: ");
|
Serial.print("Got: ");
|
||||||
Serial.println((char*)buf);
|
Serial.println((char*)buf);
|
||||||
Serial.print("RSSI: ");
|
Serial.print("RSSI: ");
|
||||||
|
|||||||
Reference in New Issue
Block a user