Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. NC 1 2 3 4 Nc
  2.  
  3. #include <x10.h>
  4. #include <x10constants.h>
  5.  
  6.  
  7. #define zcPin 2
  8. #define dataPin 3
  9.  
  10. // set up a new x10 instance:
  11. x10 myHouse;
  12.  
  13. void setup() {
  14. Serial.begin(57600);
  15. myHouse.init(zcPin, dataPin);
  16. Serial.println(myHouse.version());
  17. }
  18.  
  19. void loop() {
  20. Serial.println("Lights on:");
  21. // send a "lights on" command 3 times:
  22. myHouse.write(HOUSE_A, ON,3);
  23.  
  24. delay(500);
  25. Serial.println("Lights off:");
  26. // send a "lights off" command 3 times:
  27. myHouse.write(HOUSE_A, OFF,3);
  28. delay(500);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement