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