PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

x10_fade.pde 909B

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. X10 dimmer
  3. Dims and brightens an incandescent lamp on an X10
  4. lamp module. Example was built using a PL513
  5. X10 One-Way Interface Module from http://www.smarthome.com
  6. as the modem, and a Powerhouse X10 Lamp Module from Smarthome
  7. to plug the lamp in.
  8. created 15 June 2007
  9. by Tom Igoe
  10. */
  11. #include <x10.h>
  12. #define zcPin 2
  13. #define dataPin 3
  14. // set up a new x10 instance:
  15. x10 myHouse = x10(zcPin, dataPin);
  16. void setup() {
  17. Serial.begin(9600);
  18. // send a "Lights ON" command 3 times:
  19. myHouse.write(HOUSE_A, ON, 3);
  20. }
  21. void loop() {
  22. Serial.println("Lights up:");
  23. // send a "lights BRIGHT" command 19 times.
  24. // it takes 19 BRIGHT or DIM commands to get
  25. // an incandescent lamp dim or bright.
  26. myHouse.write(HOUSE_A, BRIGHT, 19);
  27. delay(500);
  28. Serial.println("Lights down:");
  29. // send a "lights DIM" command 19 times:
  30. myHouse.write(HOUSE_A, DIM, 19);
  31. delay(500);
  32. }