Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NC 1 2 3 4 Nc
- #include <x10.h>
- #include <x10constants.h>
- #define zcPin 2
- #define dataPin 3
- // set up a new x10 instance:
- x10 myHouse;
- void setup() {
- Serial.begin(57600);
- myHouse.init(zcPin, dataPin);
- Serial.println(myHouse.version());
- }
- void loop() {
- Serial.println("Lights on:");
- // send a "lights on" command 3 times:
- myHouse.write(HOUSE_A, ON,3);
- delay(500);
- Serial.println("Lights off:");
- // send a "lights off" command 3 times:
- myHouse.write(HOUSE_A, OFF,3);
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement