Fork of the espurna firmware for `mhsw` switches
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.

53 lines
1.2 KiB

  1. #include <RemoteSwitch.h>
  2. /*
  3. * Demo for RF remote switch transmitter.
  4. * For details, see RemoteSwitch.h!
  5. *
  6. * This sketch switches some devices on and off in a loop.
  7. */
  8. //Intantiate a new ActionSwitch remote, use pin 11
  9. ActionSwitch actionSwitch(11);
  10. //Intantiate a new KaKuSwitch remote, also use pin 11 (same transmitter!)
  11. KaKuSwitch kaKuSwitch(11);
  12. //Intantiate a new Blokker remote, also use pin 11 (same transmitter!)
  13. BlokkerSwitch blokkerSwitch(11);
  14. void setup() {
  15. }
  16. void loop() {
  17. //Switch off KaKu-device 10 on address M
  18. kaKuSwitch.sendSignal('M',10,false);
  19. //Switch on Action-device B on system code 1.
  20. actionSwitch.sendSignal(1,'B',true);
  21. //Switch on Blokker-device 7.
  22. blokkerSwitch.sendSignal(7,true);
  23. //wait 2 seconds
  24. delay(2000);
  25. //Switch on KaKu-device 2 of group 3 on address M (which is the same as device 10 on address M!)
  26. kaKuSwitch.sendSignal('M',3,2,true);
  27. //Switch off Action-device B on system code 1.
  28. actionSwitch.sendSignal(1,'B',false);
  29. //Switch off Blokker-device 7.
  30. blokkerSwitch.sendSignal(7,false);
  31. //wait 4 seconds
  32. delay(4000);
  33. }