Skip to content

Instantly share code, notes, and snippets.

@buildcircuit
Created July 2, 2013 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save buildcircuit/5907275 to your computer and use it in GitHub Desktop.
Save buildcircuit/5907275 to your computer and use it in GitHub Desktop.
315Mhz wireless transmitter
/*
SimpleSend
This sketch transmits a short text message using the VirtualWire library
connect the Transmitter data pin to Arduino pin 12
*/
#include <VirtualWire.h>
void setup()
{
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
}
void loop()
{
send("Hello there");
delay(1000);
}
void send (char *message)
{
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx(); // Wait until the whole message is gone
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment