hi I'm having trouble with the two or more data types in declaration of 'setup' err and cant figure out what wrong in trying to make a decorative terminal with different modes I got to a certain point in it and I decided do do a check and this came up
here is my code
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
int led = LED_BUILTIN;
int
void setup(){
lcd.init(); // initialize the lcd
lcd.clear();
lcd.backlight();
pinMode(1, INPUT);
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
}
void loop(){
int k;
int l;
lcd.setCursor(0,0);
lcd.print("engaging...");
for (int i = 0; i <= 100; i++){
lcd.setCursor(0,1);
lcd.print(i);
delay(100);
lcd.setCursor(3,1);
lcd.print("%");
}
delay(1000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("welcome");
lcd.setCursor(0,1);
lcd.print("blip terminal");
delay(5000);
int l = int readbutton(1,0,0,0,0)
int k = int readbutton(0,1,0,0,0)
}
}
int readbutton(int q,int w,int e,int r,int t){
int buttonState1;
int buttonState2;
int buttonState3;
int buttonState4;
int buttonState5;
if(q = 1){
buttonState1 = digitalRead(1);
return buttonState1;
}
if(w = 1){
buttonState2 = digitalRead(2);
return buttonState2;
}
if(e = 1){
buttonState3 = digitalRead(3);
return buttonState3;
}
if(r = 1){
buttonState4 = digitalRead(4);
return buttonState4;
}
if(t = 1){
buttonState5 = digitalRead(5);
return buttonState5;
}
}
Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno"
termanal:3:16: error: two or more data types in declaration of 'setup'
int led = LED_BUILTIN;
^
termanal:5:12: error: two or more data types in declaration of 'setup'
void setup(){
^
C:\Users\User\OneDrive\Documents\Arduino\termanal\termanal.ino: In function 'void loop()':
termanal:34:9: error: redeclaration of 'int l'
int l = int readbutton(1,0,0,0,0)
^
C:\Users\User\OneDrive\Documents\Arduino\termanal\termanal.ino:17:7: note: 'int l' previously declared here
int l;
^
termanal:34:13: error: expected primary-expression before 'int'
int l = int readbutton(1,0,0,0,0)
^~~
C:\Users\User\OneDrive\Documents\Arduino\termanal\termanal.ino: At global scope:
termanal:38:3: error: expected declaration before '}' token
}
^
exit status 1
two or more data types in declaration of 'setup'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.