Created
July 2, 2013 07:04
-
-
Save buildcircuit/5907275 to your computer and use it in GitHub Desktop.
315Mhz wireless transmitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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