X-Git-Url: http://git.piffa.net/web?a=blobdiff_plain;f=hardware%2Frf315_433%2Fstring_tx%2Fstring_tx.ino;fp=hardware%2Frf315_433%2Fstring_tx%2Fstring_tx.ino;h=90bcefc771c29ccc7368a4faf2649509b70bdc1e;hb=bd123f688c3566dd1413e3ec17f6b5a7134cf2cb;hp=0000000000000000000000000000000000000000;hpb=f1049e58baf973e21c716ef697458b1384f02b78;p=sketchbook_andrea diff --git a/hardware/rf315_433/string_tx/string_tx.ino b/hardware/rf315_433/string_tx/string_tx.ino new file mode 100644 index 0000000..90bcefc --- /dev/null +++ b/hardware/rf315_433/string_tx/string_tx.ino @@ -0,0 +1,24 @@ +/* String RX + +Send a string with a XD-RF-5V +- https://mashenarduinoprojects.wordpress.com/projects/arduino-315330433mhz-transmitterreceiver-xd-fstxd-rf-5v/ +*/ + +#include +//send +void setup() +{ + vw_set_ptt_inverted(true); // Required by the RF module + vw_setup(2000); // bps connection speed + vw_set_tx_pin(10); // Arduino pin to connect the receiver data pin +} + +void loop() +{ + //Message to send: + const char *msg = "This is cool"; + vw_send((uint8_t *)msg, strlen(msg)); + + vw_wait_tx(); // We wait to finish sending the message + delay(200); // We wait to send the message again +}