Buenas tardes espero recibir ayuda de alguien, al querer compilar mi código me manda este mensaje
Error compilando para la tarjeta Arduino/Genuino Mega or Mega 2560 y no se a que se daba. mi código de programación es el siguiente.
#include <LiquidCrystal.h>
//=========================================================================================================
#define TAPA1 1
#define TAPA2 2
#define BOMBAVACIO1 3
#define BOMBAVACIO2 4
#define BOLSAS1 5
#define BOLSAS2 6
#define RESISTENCIA1 7
#define RESISTENCIA2 8
#define DESFOGE1 9
#define DESFOGE2 10
#define BOTONMENU 11
#define BOTONSEG 12
#define BOTONMIL 13
#define BOTONMIC 14
#define BOTONINICIO 21
#define enter 22
LiquidCrystal lcd(15, 16, 17, 18, 19, 20);
int asegundos = 0 ;
int amilisegundos = 0;
int amicrosegundos = 0;
int segundostotal = 0;
int mensaje = 0;
int empieza = 1024;
int varBOTONSEG = 0;
int varBOTONMIL = 0;
int varBOTONMIC = 0;
void setup()
{
lcd.begin(16, 2);
pinMode(TAPA1, INPUT);
pinMode(TAPA2, INPUT);
pinMode(BOMBAVACIO1, OUTPUT);
pinMode(BOMBAVACIO2, OUTPUT);
pinMode(BOLSAS1, OUTPUT);
pinMode(BOLSAS2, OUTPUT);
pinMode(RESISTENCIA1, OUTPUT);
pinMode(RESISTENCIA2, OUTPUT);
pinMode(DESFOGE1, OUTPUT);
pinMode(DESFOGE2, OUTPUT);
pinMode(BOTONMENU, INPUT);
pinMode(BOTONSEG, INPUT);
pinMode(BOTONMIL, INPUT);
pinMode(BOTONMIC, INPUT);
pinMode(BOTONINICIO, INPUT);
pinMode(enter, INPUT);
lcd.setCursor(0, 0);
lcd.print(">");
mensaje = 0;
empieza = 100;
varBOTONSEG = 1;
varBOTONMIL = 1;
varBOTONMIC = 1;
Serial.begin (9600);
}
// ========================================================================================================
// --- Protótipo das Funções ---
void readButts();
void list_menu();
void menu_select();
// =============================================================================================================================
// --- Variáveis Globais ---
int line[5] = {0, 1, 2, 3, 4},
line_bk[5],
index,
menu_number = 1;
boolean menu_flag = 0,
enter_flag = 0,
sub_menu = 0;
// ========================================================================================================
// --- Loop Infinito ---
void loop()
{
if(mensaje==0)
{
lcd.setCursor(0,0);
lcd.print("BIENVENIDO");
lcd.setCursor(1,1);
lcd.print("A y E JARVA");
delay(10);
mensaje= 1;
lcd.clear();
}
if (!sub_menu)
{
lcd.setCursor(1, line[0]);
lcd.print("1) Vacio ");
lcd.setCursor(1, line[1]);
lcd.print("2) Bolsa ");
lcd.setCursor(1, line[2]);
lcd.print("3) Resistecia ");
lcd.setCursor(1, line[3]);
lcd.print("4) Desfogue ");
readButts();
}
do
{
varBOTONSEG = digitalRead(BOTONSEG);
varBOTONMIL = digitalRead(BOTONMIL);
varBOTONMIC = digitalRead(BOTONMIC);
if (varBOTONSEG > 0)
{
asegundos = asegundos + 1;
if (asegundos == 60) asegundos = 0;
delay(10);
}
if (varBOTONMIL > 0)
{
amilisegundos = amilisegundos + 1;
if (amilisegundos == 60) amilisegundos = 0;
delay(10);
}
if (varBOTONMIC > 0)
{
amicrosegundos = amicrosegundos + 1;
if (amicrosegundos == 10) amicrosegundos = 0;
delay(10);
}
}
while (1);
{
void readButts();
{
if (!digitalRead(BOTONMENU)) menu_flag = 0x01;
if (!digitalRead(enter)) enter_flag = 0x01;
if (digitalRead(BOTONMENU) && menu_flag)
{
menu_flag = 0x00;
list_menu();
menu_number += 1;
if (menu_number > 5) menu_number = 1;
} //end if menu
if (digitalRead(enter) && enter_flag)
{
enter_flag = 0x00;
sub_menu = !sub_menu;
menu_select();
} //end if menu
} //end readButts
void list_menu();
{
for (int i = 4; i > -1; i--)
{
index = i - 1;
line_bk[i] = line[i];
if (index < 0) line[i] = line_bk[i + 4];
else line[i] = line[i - 1];
}
} //end list_menu
void menu_select();
{
switch (menu_number)
{
case 1:
lcd.setCursor(1, 0);
lcd.print("Ajuste tiempo ");
lcd. setCursor(4, 1);
if (asegundos < 10) lcd.print("0");
lcd.print(asegundos);
lcd.print(".");
if (amilisegundos < 10) lcd.print("0");
lcd.print(amilisegundos);
lcd.print(".");
if (amicrosegundos < 10) lcd.print("0");
lcd.print(amicrosegundos);
delay(100);
case 2:
lcd.setCursor(1, 0);
lcd.print("Ajuste tiempo ");
lcd. setCursor(4, 1);
if (asegundos < 10) lcd.print("0");
lcd.print(asegundos);
lcd.print(".");
if (amilisegundos < 10) lcd.print("0");
lcd.print(amilisegundos);
lcd.print(".");
if (amicrosegundos < 10) lcd.print("0");
lcd.print(amicrosegundos);
delay(100);
case 3:
lcd.setCursor(1, 0);
lcd.print("Ajuste tiempo ");
lcd. setCursor(4, 1);
if (asegundos < 10) lcd.print("0");
lcd.print(asegundos);
lcd.print(".");
if (amilisegundos < 10) lcd.print("0");
lcd.print(amilisegundos);
lcd.print(".");
if (amicrosegundos < 10) lcd.print("0");
lcd.print(amicrosegundos);
delay(100);
case 4:
lcd.setCursor(1, 0);
lcd.print("Ajuste tiempo ");
lcd. setCursor(4, 1);
if (asegundos < 10) lcd.print("0");
lcd.print(asegundos);
lcd.print(".");
if (amilisegundos < 10) lcd.print("0");
lcd.print(amilisegundos);
lcd.print(".");
if (amicrosegundos < 10) lcd.print("0");
lcd.print(amicrosegundos);
} //end switch
} //end menu_select
}
while (digitalRead(BOTONINICIO) == 0);
segundostotal = amicrosegundos + (amilisegundos * 60) + (asegundos * 60 * 60);
while (segundostotal > 0)
{
delay(10);
segundostotal--;
asegundos = (segundostotal / ( 60 * 60)) % 60;
amilisegundos = (segundostotal / 60) % 60;
amicrosegundos = segundostotal % 60;
digitalWrite(BOMBAVACIO1, HIGH);
lcd.setCursor (0, 0);
lcd.print("TIEMPO RESTANTE");
lcd.setCursor(4, 1);
if (asegundos < 10) lcd.print("0");
lcd.print(asegundos);
lcd.print(":");
if (amilisegundos < 10) lcd.print("0");
lcd.print(amilisegundos);
lcd.print(":");
if (amicrosegundos < 10) lcd.print("0");
lcd.print(amicrosegundos);
if (segundostotal == 0)
{
while (1)
{
lcd.clear();
lcd.setCursor(5, 0);
lcd.print("TIEMPO");
lcd.setCursor(3, 1);
lcd.print("FINALIZADO");
digitalWrite(BOMBAVACIO1, LOW);
digitalWrite(BOLSAS1, HIGH);
delay(100);
digitalWrite(BOLSAS1, LOW);
}
}
}
}