This commit is contained in:
Thaddeus Hughes
2025-08-24 07:39:06 -05:00
commit 9bc81a9ebf
85 changed files with 211900 additions and 0 deletions

30
rf_rx/rf_rx.ino Normal file
View File

@@ -0,0 +1,30 @@
#include <RH_ASK.h>
#include <SPI.h> // Required for RadioHead, though not used directly
// Initialize the RF receiver (default pin is 11, change if needed)
RH_ASK rf_driver(2000, 17, 17); // 2000 bps, DATA pin on 17
void setup() {
Serial.begin(115200);
Serial.println("Good morning...");
if (!rf_driver.init()) {
Serial.println("RF Receiver initialization failed!");
}
pinMode(32, OUTPUT);
}
bool state = false;
void loop() {
uint8_t buf[RH_ASK_MAX_MESSAGE_LEN]; // Buffer for incoming message
uint8_t buflen = sizeof(buf);
if (rf_driver.recv(buf, &buflen)) { // Check if a message is received
buf[buflen] = '\0'; // Null-terminate the string
Serial.print("Message received: ");
Serial.println((char*)buf); // Print the received message
state = !state;
digitalWrite(32, state);
}
}