// pinnen.h - de pintabel van de klimaatmodule (Arduino Mega 2560), hoofdstuk 29; D12 erbij in hoofdstuk 31
// Eén bestand voor alle schetsen van de module: verandert er een pin, dan pas je het maar op één plaats aan.
#ifndef PINNEN_H
#define PINNEN_H

// analoge ingangen (0 tot 5 V, 10 bit)
const int NTC = A0;             // NTC 10 kOhm in het voedingsreservoir (hoofdstuk 22)
const int LDR = A1;             // lichtsensor onder een kapje, 1,0 kOhm naar GND (hoofdstuk 22)
const int PH = A2;              // pH-module (hoofdstuk 15)
const int BATTERIJ = A3;        // deler 100 kOhm / 33 kOhm (hoofdstuk 22)
const int STROOM = A4;          // ACS712-20A in de batterijleiding (hoofdstuk 16)
const int DRUK = A5;            // MPX5010: het niveau van het reservoir (hoofdstuk 11)
const int EC = A6;              // geleidbaarheid (hoofdstuk 13)

// digitale ingangen
const int VLOTTER = 2;          // naar GND, INPUT_PULLUP: LOW = genoeg water (hoofdstuk 23)
const int KNOP = 22;            // S1 'kasdak' via RC + 74HC14, INPUT: HIGH = ingedrukt (hoofdstuk 24)
const int EIND_OPEN = 23;       // verbreekcontact, INPUT_PULLUP: HIGH = dak open (hoofdstuk 26)
const int EIND_DICHT = 24;      // verbreekcontact, INPUT_PULLUP: HIGH = dak dicht

// uitgangen
const int LAMPEN = 5;           // PWM (490 Hz) naar de IRLZ44N van de groeilampen (hoofdstuk 25)
const int PWM_DICHT = 6;        // H-brug: sluiten (hoofdstuk 26)
const int PWM_OPEN = 7;         // H-brug: openen
const int DAK_ENABLE = 8;       // H-brug: beide helften vrijgeven
const int POMP = 9;             // IRLZ44N van de pomp (hoofdstuk 23)
const int CO2_KLEP = 10;        // IRLZ44N van de CO2-klep
const int VENTILATOREN = 11;    // IRLZ44N van de ventilatoren
const int VERWARMING = 12;      // IRLZ44N: klep en ventilator van de convector (hoofdstuk 31)
const int STATUSLED = 13;       // groene statusled (en het ledje L op het bordje)

// I2C: SDA = 20, SCL = 21 (vast op de Mega)

#endif
