#include "PseudoKlasse.h"
#include "Settings.h"

constexpr uint8_t DEV_BUTTON_PIN     {7};   
constexpr uint8_t VAL_BUTTON_PIN     {6}; // Pin (D6) for switching the backlight on
constexpr uint16_t TIMER_DURATION {5000}; 

 /////////////////////////////////////////////////////////////////////
// Shift register control
// 
// Arduino-Pin connected to SRCLK/SHCP (SHCP = Pin 11 of 74HC595)
constexpr uint8_t CLOCK_PIN = 12;
// Arduino-Pin connected to RCLK (STCP = Pin 12 of 74HC595)
constexpr uint8_t STORE_PIN = 11;
// Arduino-Pin connected to SER (DS = Pin 14 of 74HC595)
constexpr uint8_t DATA_PIN = 10;

MoistureMeter mData[4] = { {837,413,696},
                           {837,413,696},
                           {837,413,696},
                           {837,413,696}
                        };
Settings::Input input;

void setup() {
  Serial.begin(115200);
  Serial.println(("Begin"));
  input.init(mData, TIMER_DURATION, DEV_BUTTON_PIN, VAL_BUTTON_PIN, CLOCK_PIN, STORE_PIN, DATA_PIN);
}

void loop() {
  // put your main code here, to run repeatedly:
  input.selectDevice();
  input.setMoistureThreshold();
}

74HC595