RF Modulev 433Mhz Transmit Received

RM 15.00
Package included : RF Modulev 433Mhz Transmit Received x 1 Unit

Specifications RF 433MHz Receiver

Frequency Range: 433.92 MHz
Modulation: ASK
Input Voltage: 5V

Specifications RF 433MHz Transmitter

Frequency Range: 433.92MHz
Input Voltage: 3-12V

Schematic


Library: Radio Head 

What The code do :
1. Transmitter send "Hello World!". It will send it again and again.
2. If Receiver received "Hello World!" , Led on pin D13 will Blink.


// Test Code for receiver // Data pin connect to pin 11 #include <RH_ASK.h> #include <SPI.h> // Not actualy used but needed to compile RH_ASK driver; int toggle = 0; void setup() { pinMode(13, OUTPUT); digitalWrite(13, toggle); Serial.begin(9600); // Debugging only if (!driver.init()) Serial.println("init failed"); } void loop() { uint8_t buf[12]; uint8_t buflen = sizeof(buf); if (driver.recv(buf, &buflen)) // Non-blocking { int i; // Message with a good checksum received, dump it. Serial.print("Message: "); Serial.println((char*)buf); if (strstr((char*)buf, "Hello World!") != NULL) { toggle = ~toggle; digitalWrite(13, toggle); } } } //Test code for transmitter //Data pin connect to pin 12 #include <RH_ASK.h> #include <SPI.h> // Not actually used but needed to compile RH_ASK driver; void setup() { Serial.begin(9600); // Debugging only if (!driver.init()) Serial.println("init failed"); } void loop() { const char *msg = "Hello World!"; driver.send((uint8_t *)msg, strlen(msg)); driver.waitPacketSent(); delay(1000); }