Advertisement
Guest User

VirtualWire.SimpleSend

a guest
Mar 27th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. /*
  2. SimpleSend
  3. This sketch transmits a short text message using the VirtualWire library
  4. connect the Transmitter data pin to Arduino pin 12
  5. */
  6. #include <VirtualWire.h>
  7. void setup()
  8. {
  9. // Initialize the IO and ISR
  10. vw_setup(2000); // Bits per sec
  11. }
  12. void loop()
  13. {
  14. send("Hello there");
  15. delay(1000);
  16. }
  17. void send (char *message)
  18. {
  19. vw_send((uint8_t *)message, strlen(message));
  20. vw_wait_tx(); // Wait until the whole message is gone
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement