String menuItems[] = {"TERRARIUM 1", "TERRARIUM 2", "TERRARIUM 3", "TERRARIUM 4", "TERRARIUM 5", "TERRARIUM 6", "TERRARIUM 7", "TERRARIUM 8"," "};
// Navigation button variables
int readKey;
int savedDistance = 0;
// Menu control variables
int menuPage = 0;
int maxMenuPages = 9;
int cursorPosition = 0;
// Creates 3 custom characters for the menu display
byte downArrow[8] = {
0b00100, // *
0b00100, // *
0b00100, // *
0b00100, // *
0b00100, // *
0b10101, // * * *
0b01110, // ***
0b00100 // *
};
byte upArrow[8] = {
0b00100, // *
0b01110, // ***
0b10101, // * * *
0b00100, // *
0b00100, // *
0b00100, // *
0b00100, // *
0b00100 // *
};
byte menuCursor[8] = {
B01000, // *
B00100, // *
B00010, // *
B00001, // *
B00010, // *
B00100, // *
B01000, // *
B00000 //
};
byte degres[8] = { // DECLARATION D'UN TABLEAU DE 8 OCTETS POUR LE CARACTERE DEGRES
B00111,
B00101,
B00111,
B00000,
B00000,
B00000,
B00000,
};
byte trait[8]={ // DECLARATION D'UN TABLEAU DE 8 OCTETS POUR LE CARACTERE TRAIT
B00100,
B00100,
B00100,
B00100,
B00100,
B00100,
B00100,
B00100
};
byte case_vide[8]={ // DECLARATION D'UN TABLEAU DE 8 OCTETS POUR LE CARACTERE CASE VIDE
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
};
#include <Wire.h>
#include <LiquidCrystal.h>
#include <OneWire.h> // INCLURE LA LIBRAIRIE ONEWIRE
#include <DallasTemperature.h> // INCLURE LA LIBRAIRIE DALLAS TEMPERATURE
#include "RTClib.h" //INCLURE LA LIBRAIRIE RTCLIB (HORLOGE RTC)
RTC_DS1307 RTC; //CLASSE RTC_DS1307
// Setting the LCD shields pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
const int RELAIS_1=30; // RELAIS 1 SUR PIN 30
const int RELAIS_2=31; // RELAIS 2 SUR PIN 31
const int RELAIS_3=32; // RELAIS 3 SUR PIN 32
const int RELAIS_4=33; // RELAIS 4 SUR PIN 33
const int RELAIS_5=34; // RELAIS 5 SUR PIN 34
const int RELAIS_6=35; // RELAIS 6 SUR PIN 35
const int RELAIS_7=36; // RELAIS 7 SUR PIN 36
const int RELAIS_8=37; // RELAIS 8 SUR PIN 37
const int Cons_jour_terra_1 = 32;
const int Cons_jour_terra_2 = 32;
const int Cons_jour_terra_3 = 32;
const int Cons_jour_terra_4 = 32;
const int Cons_jour_terra_5 = 32;
const int Cons_jour_terra_6 = 32;
const int Cons_jour_terra_7 = 32;
const int Cons_jour_terra_8 = 32;
const int Cons_nuit_terra_1 = 29;
const int Cons_nuit_terra_2 = 29;
const int Cons_nuit_terra_3 = 29;
const int Cons_nuit_terra_4 = 29;
const int Cons_nuit_terra_5 = 29;
const int Cons_nuit_terra_6 = 29;
const int Cons_nuit_terra_7 = 29;
const int Cons_nuit_terra_8 = 29;
// DEFINITION DES PORTS BUS ONEWIRE
#define ONE_WIRE_BUS_1 22 // BUS ONEWIRE SONDE 1 SUR PIN 22
#define ONE_WIRE_BUS_2 23 // BUS ONEWIRE SONDE 2 SUR PIN 23
#define ONE_WIRE_BUS_3 24 // BUS ONEWIRE SONDE 3 SUR PIN 24
#define ONE_WIRE_BUS_4 25 // BUS ONEWIRE SONDE 4 SUR PIN 25
#define ONE_WIRE_BUS_5 26 // BUS ONEWIRE SONDE 5 SUR PIN 26
#define ONE_WIRE_BUS_6 27 // BUS ONEWIRE SONDE 6 SUR PIN 27
#define ONE_WIRE_BUS_7 28 // BUS ONEWIRE SONDE 7 SUR PIN 28
#define ONE_WIRE_BUS_8 29 // BUS ONEWIRE SONDE 8 SUR PIN 29
// DEFINITION DES PORTS COMMUNICATIONS BUS ONEWIRE
OneWire oneWire_1(ONE_WIRE_BUS_1); //BUS ONEWIRE_1 SUR ONEWIRE 1
OneWire oneWire_2(ONE_WIRE_BUS_2); //BUS ONEWIRE_2 SUR ONEWIRE 2
OneWire oneWire_3(ONE_WIRE_BUS_3); //BUS ONEWIRE_3 SUR ONEWIRE 3
OneWire oneWire_4(ONE_WIRE_BUS_4); //BUS ONEWIRE_4 SUR ONEWIRE 4
OneWire oneWire_5(ONE_WIRE_BUS_5); //BUS ONEWIRE_5 SUR ONEWIRE 5
OneWire oneWire_6(ONE_WIRE_BUS_6); //BUS ONEWIRE_6 SUR ONEWIRE 6
OneWire oneWire_7(ONE_WIRE_BUS_7); //BUS ONEWIRE_7 SUR ONEWIRE 7
OneWire oneWire_8(ONE_WIRE_BUS_8); //BUS ONEWIRE_8 SUR ONEWIRE 8
// DEFINITION DES NOMS DE PORTS ONEWIRE
DallasTemperature sensors_1(&oneWire_1); // LA COMMANDE "SENSORS_1" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_1
DallasTemperature sensors_2(&oneWire_2); // LA COMMANDE "SENSORS_2" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_2
DallasTemperature sensors_3(&oneWire_3); // LA COMMANDE "SENSORS_3" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_3
DallasTemperature sensors_4(&oneWire_4); // LA COMMANDE "SENSORS_4" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_4
DallasTemperature sensors_5(&oneWire_5); // LA COMMANDE "SENSORS_5" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_5
DallasTemperature sensors_6(&oneWire_6); // LA COMMANDE "SENSORS_6" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_6
DallasTemperature sensors_7(&oneWire_7); // LA COMMANDE "SENSORS_7" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_7
DallasTemperature sensors_8(&oneWire_8); // LA COMMANDE "SENSORS_8" LIRA LA TEMPERATURE SUR LE BUS ONEWIRE_8