need help with school proyect

hello, my name is Bruno and i started with Arduino a few months ago, im studing mechatronics and i have to create a button panel for a machine, START ,STOP, TUNNING STOP, MAINTENANCE STOP, and through thingspeak callect the information.

so far, i could only make buttons turno on each led.
i want to create this condition but i dont know how to doi it

if button STAR HIGH, led 1 HIGH, the rest of them DOWN.
if button STOP HIGH, led 2 HIGH, led 1,3,4 DOWN.
if button TUNNING STOP HIGH,led 3 HIGH, led 1,2,4 DOWN.
if button MAINTENANCE STOP HIGH, led 4 HIGH, led 1,2,3 DOWN.

const int LED1 = 13; // led marcha maquina
const int LED2 = 12; // led parada maquina
const int LED3 = 11; // led parada puesta punto
const int LED4 = 10; // led parada mantenimiento

const int BOTON1 = 7; // pulsador marcha maquina
const int BOTON2 = 6; // pulsador parada maquina
const int BOTON3 = 5; // pulsador parada puesta punto
const int BOTON4 = 4; // pulsador parada mantenimiento

int val1 = 0; // almacena estado del boton
int val2 = 0;
int val3 = 0;
int val4 = 0;

int state1 = 0; // 0 LED apagado, mientras que 1 encendido
int state2 = 0;
int state3 = 0;
int state4 = 0;

int old_val1 = 0; // almacena el antiguo valor de val
int old_val2 = 0;
int old_val3 = 0;
int old_val4 = 0;

void setup()
{
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
pinMode(LED4,OUTPUT);

pinMode(BOTON1,INPUT);
pinMode(BOTON2,INPUT);
pinMode(BOTON3,INPUT);
pinMode(BOTON4,INPUT);

}

void loop(){

val1= digitalRead(BOTON1); // lee el estado del Boton
if ((val1 == HIGH) && (old_val1 == LOW)){
state1=1-state1;
delay(10);
}
old_val1 = val1; // valor del antiguo estado
if (state1==1){
digitalWrite(LED1, HIGH); // enciende el LED
}
else{
digitalWrite(LED1,LOW); // apagar el LED
}

val2= digitalRead(BOTON2);
if ((val2 == HIGH) && (old_val2 == LOW)){
state2=1-state2;
delay(10);
}
old_val2 = val2;
if (state2==1){
digitalWrite(LED2, HIGH);
}
else{
digitalWrite(LED2,LOW);
}

val3= digitalRead(BOTON3);
if ((val3 == HIGH) && (old_val3 == LOW)){
state3=1-state3;
delay(10);
}
old_val3 = val3;
if (state3==1){
digitalWrite(LED3, HIGH);
}
else{
digitalWrite(LED3,LOW);
}

val4= digitalRead(BOTON4);
if ((val4 == HIGH) && (old_val4 == LOW)){
state4=1-state4;
delay(10);
}
old_val4 = val4;
if (state4==1){
digitalWrite(LED4, HIGH);
}
else{
digitalWrite(LED4,LOW);
}

}

Is there a question hidden somewhere?

Write a little function that just switches all LEDs off/LOW. Then as soon as you have decided to switch any one of LEDs on call that function first.

Steve

Please read 'how to use this forum - please read', then go back and modify your original post to include code tags and a meaningful question.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :)

on the bottom right of your posts is a button to modify your post.

read how to use this forum #6 about subject lines and make a subject line that works for the project.

read #7 about how to fix your post to put the code in "code tags"