Advertisement
computermuseo

trasmettitore 433Mhz arduino

May 8th, 2015
2,591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <VirtualWire.h>
  2. char *controller;
  3. void setup() {
  4. pinMode(13,OUTPUT);
  5. vw_set_ptt_inverted(true); //
  6. vw_set_tx_pin(12);
  7. vw_setup(4000);// speed of data transfer Kbps
  8. }
  9.  
  10. void loop(){
  11. controller="1" ;
  12. vw_send((uint8_t *)controller, strlen(controller));
  13. vw_wait_tx(); // Wait until the whole message is gone
  14. digitalWrite(13,1);
  15. delay(2000);
  16. controller="0" ;
  17. vw_send((uint8_t *)controller, strlen(controller));
  18. vw_wait_tx(); // Wait until the whole message is gone
  19. digitalWrite(13,0);
  20. delay(2000);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement