i'm new to the world of arduino, i made a alcohol gel dispenser but when i press the check button, it shows this error message: "expected "}" at end of input"
#include <LiquidCrystal_I2C.h>
#include <Wire.h> //Biblioteca para I2C
#include <SparkFunMLX90614.h> //Biblioteca SparkFunMLX90614
#define sensor A0
LiquidCrystal_I2C lcd(0x27, 16,2);
IRTherm therm;
int entrada;
int motor = 8; //porta digital para controle do motor bomba de água
int sensorGel = 11; //sensor frontal
int sensorLed =10; //sendor lateral
int led = 9; //portal digital para controle do led
int sensorGelEstado;
int sensorLedEstado;
void setup()
{
pinMode(motor, OUTPUT);
pinMode(led, OUTPUT);
pinMode(sensorGel,INPUT);
pinMode(sensorLed,INPUT);
lcd.begin(16, 2);
lcd.print("Temperatura: ");
therm.begin(); //Inicializa sensor de temperatura infravermelho
therm.setUnit(TEMP_C); //Seleciona temperatura em Celsius
}
void loop()
{
if (therm.read()) // On success, read() will return 1, on fail 0.
{
int sensorGelEstado = digitalRead(sensorGel);
if (sensorGelEstado == HIGH) //nenhum objeto detectado
{
digitalWrite(motor,LOW); //desliga o motor
}
else //objeto detectado
{
digitalWrite(motor,HIGH); //liga o motor por 1 segundo
delay(1000);
digitalWrite(motor,LOW); // desliga o motor e espera 1 segundo e meio para ser possível retirar a mão
delay(1500);
}
sensorLedEstado = digitalRead(sensorLed);
if (sensorLedEstado == HIGH) //nenhum objeto detectado
{
digitalWrite(led,LOW); // desliga o led
}
else //objeto detectado
{
digitalWrite(led,HIGH); // liga o led por 3 segundos
delay(3000);
digitalWrite(led,LOW);
}
{
if (therm.read()) // On success, read() will return 1, on fail 0.
{
lcd.setCursor(0,0);
lcd.print("Temperatura:");
lcd.setCursor(0,1);
lcd.print(therm.object(), 2);
lcd.write('°');
lcd.setCursor(6,1);
lcd.print("C");
}
delay(2000);
}