/*
Nome: Aplicação para automatisar uma maquina de lavar louça.
Dev: Marcelo Olimpio.
Empresa: Boxhoney.
Url: https://github.com/Boxhoney.
*/
// definição
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h> // library required for IIC communication
#include <OneWire.h>
#include <DallasTemperature.h>
U8G2_SSD1306_128X64_NONAME_F_HW_I2C lcd (U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // initialization for the used OLED display
#define porta 12
#define power 11
#define select 10
#define sensorAgua 9
#define ONE_WIRE_BUS 8
#define valvulaEnt 7
#define resistencia 6
#define bombaLav 5
#define bombaSaida 4
#define valvulaSec 3
// botões-----------------------------------
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
///iniciar variaveis---------------------------------
//fonte 6px u8g2_font_pcsenior_8u;
int status;
double tempo;
void setup() {
lcd.begin(); Serial.begin(9600); sensors.begin();
pinMode(power, INPUT_PULLUP);
pinMode(select, INPUT_PULLUP);
pinMode(sensorAgua, INPUT_PULLUP);
pinMode(porta, INPUT_PULLUP);
///-----------------------------------------------
pinMode(bombaSaida, OUTPUT);
pinMode(bombaLav, OUTPUT);
pinMode(resistencia, OUTPUT);
pinMode(valvulaEnt, OUTPUT);
pinMode(valvulaSec, OUTPUT);
///iniciar funções-----------------------------------
void boasVindas();
boasVindas();
}
void loop(){
sensors.requestTemperatures();
lcd.clearDisplay();
}
// funções -------------------------------------------------------
void boasVindas(){
lcd.clearBuffer();
lcd.setFont(u8g2_font_pcsenior_8u);
lcd.drawStr(32,7,"BOX HONEY");
lcd.drawLine(2, 9, 127, 9);
lcd.drawStr(0,18,"PROJETO LAVADORA");
lcd.sendBuffer();
delay(5000);
}