Files
hopper_traps/rf_tx/rf_tx.ino
Thaddeus Hughes 9bc81a9ebf init
2025-08-24 07:39:06 -05:00

25 lines
753 B
C++

#include <RH_ASK.h> // RadioHead library
#include <SPI.h> // Required for RadioHead, though not used directly
// Initialize the RF transmitter (default pin is 12, change if needed)
RH_ASK rf_driver(2000, 10, 10); // 2000 bps, DATA pin on 10
void setup() {
Serial.begin(115200);
if (!rf_driver.init()) {
Serial.println("RF Transmitter initialization failed!");
}
pinMode(3, INPUT);
}
void loop() {
while(digitalRead(3))
delay(100);
const char *msg = "Hello, RFF World!"; // Message to send
rf_driver.send((uint8_t *)msg, strlen(msg)); // Send the message
rf_driver.waitPacketSent(); // Wait until the message is sent
Serial.println("Message sent: Hello, RFF World!");
delay(500); // Wait 1 second before sending again
}