init
This commit is contained in:
20
flasher/flasher.ino
Normal file
20
flasher/flasher.ino
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <RH_ASK.h>
|
||||
#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); // 2000 bps, DATA pin on 10
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
if (!rf_driver.init()) {
|
||||
Serial.println("RF Transmitter initialization failed!");
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
const char *msg = "Hello, RF 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, RF World!");
|
||||
delay(1000); // Wait 1 second before sending again
|
||||
}
|
||||
Reference in New Issue
Block a user