Download the file
  1. #include <RF12.h>
  2. #include <Ports.h>
  3. #include "heater_controller_slave.h"
  4. #include "listener.h"
  5. #include "speaker.h"
  6. #include "protocol.h"
  7.  
  8.  
  9. Speaker speaker;
  10. Protocol protocol(&speaker);
  11. Listener listener(&protocol);
  12.  
  13. Task * tasks[] = { &listener, &speaker };
  14. TaskScheduler scheduler(tasks, NB_ELEMENTS(tasks));
  15.  
  16. void setup() {
  17. Serial.begin(57600);
  18. rf12_initialize(SLAVE_ID, RF12_868MHZ, HEATER_GROUP);
  19. }
  20.  
  21. void loop() {
  22. scheduler.run(); // infinite loop
  23. }
  24.