Download this file
#include "sensor.h"
#include "button.h"
#include "indicator.h"
#include "blinker.h"

Indicator indicator;
Sensor sensor(&indicator);
Blinker blinker(&sensor);
Button button(&sensor);

Task * tasks[] = { &sensor, &blinker, &button };
TaskScheduler scheduler(tasks, NB_ELEMENTS(tasks));

void setup() {
  Serial.begin(57600);
  sensor.begin();
  // Small animation untill the sensor has made its first measurement.
  for(uint8_t i=0; i<5; i++) {
    digitalWrite(GREEN_LED_PIN, HIGH);
    digitalWrite(RED_LED_PIN, LOW);
    delay(200);
    digitalWrite(GREEN_LED_PIN, LOW);
    digitalWrite(RED_LED_PIN, HIGH);
    delay(200);
  }
}

void loop() {
  scheduler.run(); // infinite loop
}