Hi there, im trying to get this code to work but I'm having a bit of trouble. My final objective is to get four buttons hooked up an LCD and make one button print num=1, button 2 print num=2, button 3 print num=5 and button 4 print num=10. Each time you press them they add up to a final result. I think I have to use 00 = addition; function and int num too. Im really not sure and I would appreciate some help. I think it's a fairly simple project but for some reason I can't get it to work. What I want is to add numbers,1 ,2, 5 and 10 to a final result.
#include <LiquidCrystal.h>
int value_in1=0;
int value_in2=0;
int value_in3=0;
int value_in4=0;
int flag1=0;
int flag2=0;
int flag3=0;
int flag4=0;
int number=0;
int input1=0;
int oper=0;
int output=0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
lcd.begin(16, 2);
lcd.print("Numbers");
delay(1000);
pinMode(7,INPUT);
pinMode(8,INPUT);
pinMode(9,INPUT);
pinMode(10,INPUT);
}
void loop() {
value_in1=digitalRead(7);
value_in2=digitalRead(

;
value_in3=digitalRead(9);
value_in4=digitalRead(10);
lcd.clear();
if ((value_in1==HIGH)&&(flag1==0)){
flag1=1;
}
else {
input1=input1+1;
}
number=input1;
}
else if (value_in1==LOW){
input1=input1;
flag1=0;
lcd.setCursor(0,1);
lcd.print(1);
}
else{
delay(200);
}
}
Notes: Im not a experienced programmer, I think it's kind of a mess. I can't get it to print o work.