]> git.piffa.net Git - sketchbook_andrea/blob - hardware/rf315_433/string_tx/string_tx.ino
RF string
[sketchbook_andrea] / hardware / rf315_433 / string_tx / string_tx.ino
1 /* String RX
2
3 Send a string with a XD-RF-5V
4 - https://mashenarduinoprojects.wordpress.com/projects/arduino-315330433mhz-transmitterreceiver-xd-fstxd-rf-5v/
5 */
6
7 #include <VirtualWire.h>
8 //send
9 void setup()
10 {
11     vw_set_ptt_inverted(true);  // Required by the RF module
12     vw_setup(2000);            // bps connection speed
13     vw_set_tx_pin(10);         // Arduino pin to connect the receiver data pin
14 }
15  
16 void loop()
17 {
18    //Message to send:
19    const char *msg = "This is cool";
20    vw_send((uint8_t *)msg, strlen(msg));
21
22    vw_wait_tx();        // We wait to finish sending the message
23    delay(200);         // We wait to send the message again                
24 }