Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <LwTx.h>
  2.  
  3. byte zapnout[] = {0,0,0,0,0,0,0,0,0,1};
  4. byte vypnout[] = {0,0,0,0,0,0,0,0,0,0};
  5.  
  6. void setup() {
  7.   Serial.begin(9600);
  8.  
  9.   // nastavĂ­ pin 4 a 5 jako vstup
  10.   pinMode(4, INPUT);
  11.   pinMode(5, INPUT);
  12.  
  13.   lwtx_setup(3, 2);
  14. }
  15.  
  16. void loop()
  17. {
  18.   if (digitalRead(4) == 1) {Zapnout();delay(400);}
  19.   if (digitalRead(5) == 1) {Vypnout();delay(400);}
  20. }
  21.  
  22. void Zapnout()
  23. {
  24.   if (lwtx_free())
  25.    {
  26.    lwtx_send(zapnout);
  27.    }
  28. }
  29.  
  30. void Vypnout()
  31. {
  32.   if (lwtx_free())
  33.    {
  34.    lwtx_send(vypnout);
  35.    }
  36. }