I recently got a set of: 433Mhz RF Wireless Transmitter + Receivers. I did some searching and found these tow sketches. They almost work. But instead of printing "Hello" on the screen of the computer connected to the receiver, it seems to be sending a string of numbers like: 48 65 6c 6c 6f. I need to be able to send short text strings. Any Idea whats up? I'm using two Arduino Uno's.
Transmitter Code:
// Transmitter Code
#include <VirtualWire.h>
//Grove - 315(433) RF link kit Demo v1.0
//by :http://www.seeedstudio.com/
//connect the sent module to D2 to use
#include <VirtualWire.h>
int RF_TX_PIN = 12;
void setup()
{
vw_set_tx_pin(RF_TX_PIN); // Setup transmit pin
vw_setup(9600); // 2000 Transmission speed in bits per second.
}
void loop()
{
const char *msg = "Hello";
vw_send((uint8_t *)msg, strlen(msg)); // Send 'hello' every 400ms.
delay(400);
}
The receiver code:
// Recever//Grove - 315(433) RF link kit Demo v1.0
//by :http://www.seeedstudio.com/
//connect the receive module to D2 to use ..
#include <VirtualWire.h>
int RF_RX_PIN = 7;
void setup()
{
Serial.begin(9600);
Serial.println("setup");
vw_set_rx_pin(RF_RX_PIN); // Setup receive pin.
vw_setup(2000); // Transmission speed in bits per second.
vw_rx_start(); // Start the PLL receiver.
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if(vw_get_message(buf, &buflen)) // non-blocking I/O
{
int i;
// Message with a good checksum received, dump HEX
Serial.print("Got: ");
for(i = 0; i < buflen; ++i)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
//Serial.print(buf[i]);
}
Serial.println("");
}
}