kompost.ino 652 Bytes
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <Wire.h>

#include "wifi.h"
#include "sonar.h"
#include "pcf.h"
#include "mqtt.h"
#include "queue.h"
#include "pump.h"
#include "control.h"

unsigned int counter = 0;


void setup(void) {
  Serial.begin(115200);
  delay(100);
  setup_wifi();
  setup_sonar();
  setup_pcf();
  setup_mqtt();
  setup_queue();
}

void loop(void) {
  MDNS.update();
  delay(500);
  counter++;
  loop_sonar(counter);

  String liquidLevelAvgStr(liquid_level_avg());
  mqttClient.publish(PREAMBLE T_SDIST, liquidLevelAvgStr );

  loop_pcf();
  loop_queue();
  loop_control(counter);
  next_sequence_step();
}