SOLVED! Driving multiple output

Hi Guys. I do have a little problem with solving this case. i have 8 leds and 10 buttons first 8 buttons turn every led individually. button number 9 turn 4 leds at time button number 10 turn another 4 leds at time.

my question is why only those buttons numner 9, and 10 work and 1-8 don`t. it cannot be that complicated right?

Inputs are connected through internal PULLUP

//Single
  digitalWrite(FLSolUp, !digitalRead(FLUp));
  digitalWrite(FLSolDown, !digitalRead(FLDown));
  digitalWrite(FRSolUp, !digitalRead(FRUp));
  digitalWrite(FRSolDown, !digitalRead(FRDown));
  digitalWrite(RLSolUp, !digitalRead(RLUp));
  digitalWrite(RLSolDown, !digitalRead(RLDown));
  digitalWrite(RRSolUp, !digitalRead(RRUp));
  digitalWrite(RRSolDown, !digitalRead(RRDown));
  //All UP
  if (digitalRead(allUp) == LOW)
  {
    digitalWrite (FLSolUp, HIGH);
    digitalWrite (FRSolUp, HIGH);
    digitalWrite (RLSolUp, HIGH);
    digitalWrite (RRSolUp, HIGH);
     }
  else
  {
    digitalWrite (FLSolUp, LOW);
    digitalWrite (FRSolUp, LOW);
    digitalWrite (RLSolUp, LOW);
    digitalWrite (RRSolUp, LOW);
  }
  //All down
  if (digitalRead(allDown) == LOW)
 {
  digitalWrite (FLSolDown, HIGH);
  digitalWrite (FRSolDown, HIGH); 
  digitalWrite (RLSolDown, HIGH); 
  digitalWrite (RRSolDown, HIGH); 
 }
 else
 {
  digitalWrite (FLSolDown, LOW);
  digitalWrite (FRSolDown, LOW); 
  digitalWrite (RLSolDown, LOW); 
  digitalWrite (RRSolDown, LOW); 
 }

i simply want momentary ON/OFF

you could try posting your code

//Front panel control
#include "ST7565.h"
#include <EEPROM.h>

//▼ Inputs Pins
const int FLUp = 30;
const int FLDown = 31;
const int FRUp = 32;
const int FRDown = 33;
const int RLUp =34;
const int RLDown = 35;
const int RRUp = 36;
const int RRDown = 37;
const int allUp = 40;
const int allDown = 41;
const int autoAllUp = 48;
const int autoAllDown = 49;
//▼Outputs Pins
const int FLSolUp = 22;
const int FLSolDown = 23;
const int FRSolUp = 24;
const int FRSolDown = 25;
const int RLSolUp = 26;
const int RLSolDown = 27;
const int RRSolUp = 28;
const int RRSolDown = 29;
//▼Sensor Inputs
int sensor1 = A0;
int sensor2 = A1;
int sensor3 = A2;
int sensor4 = A4;
int sensor5 = A5;
//▼Button state (Variable)
int state1 = 0;
int state2 = 0;
int state3 = 0;
int state4 = 0;
int state5 = 0;
int state6 = 0;
int state7 = 0;
int state8 = 0;
int state9 = 0;
int state10 = 0;
int state11 = 0;
int state12 = 0;
int state13 = 0;
//▼RGB
int redPin = 12;
int greenPin = 11;
int bluePin = 10;
const byte RGBbut = 52;
byte ButtonState;
byte lastState = LOW;
byte count = 0;
//▼Other
char Val[5]; 
char buffer[5];
int raw;
float voltage;
float pressure; //Pressure PSI


ST7565 glcd(9, 8, 7, 6, 5);

#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 

// a bitmap of a KRONE icon
static unsigned char __attribute__ ((progmem)) logo16_glcd_bmp[]={
0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0xf8, 0xbe, 0x9f, 0xff, 0xf8, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 
0x20, 0x3c, 0x3f, 0x3f, 0x1f, 0x19, 0x1f, 0x7b, 0xfb, 0xfe, 0xfe, 0x07, 0x07, 0x07, 0x03, 0x00, };

void BarFL(int value = sensor1, int low = 0, int high = 150, int x = 30, int y = 24, int w = 33, int h = 19, int F_color =  BLACK, int B_color = WHITE); //Bargraph 1 FL

void setup()
{
 Serial.begin(9600);
 // initialize and set the contrast to 0x18
 glcd.begin(0x18);

 glcd.display(); // show Logo
 delay(2000);
 glcd.clear();
 
 //▼RGB
 setColor(0, 0, 0);
 count = EEPROM.read(10);
 pinMode(RGBbut, INPUT_PULLUP);
 pinMode(redPin, OUTPUT);
 pinMode(greenPin, OUTPUT);
 pinMode(bluePin, OUTPUT);     
 //▼Buttons
 pinMode(FLUp, INPUT_PULLUP);
 pinMode(FLDown, INPUT_PULLUP);
 pinMode(FRUp, INPUT_PULLUP);
 pinMode(FRDown, INPUT_PULLUP);
 pinMode(RLUp, INPUT_PULLUP);
 pinMode(RLDown, INPUT_PULLUP);
 pinMode(RRUp, INPUT_PULLUP);
 pinMode(RRDown, INPUT_PULLUP);
 pinMode(allUp, INPUT_PULLUP);
 pinMode(allDown, INPUT_PULLUP);
 pinMode(autoAllUp, INPUT_PULLUP);
 pinMode(autoAllDown, INPUT_PULLUP);
 pinMode(RGBbut, INPUT_PULLUP); 
 //▼Solenoids  
 pinMode(FLSolUp, OUTPUT);
 pinMode(FLSolDown, OUTPUT);
 pinMode(FRSolUp, OUTPUT);
 pinMode(FRSolDown, OUTPUT);
 pinMode(RLSolUp, OUTPUT);
 pinMode(RLSolDown, OUTPUT);
 pinMode(RRSolUp, OUTPUT);
 pinMode(RRSolDown, OUTPUT);
 //▼Pressure Sensors
 pinMode(sensor1, INPUT);
 pinMode(sensor2, INPUT);
 pinMode(sensor3, INPUT);
 pinMode(sensor4, INPUT);
 pinMode(sensor5, INPUT);
}



void loop()
{
//Single
 digitalWrite(FLSolUp, !digitalRead(FLUp));
 digitalWrite(FLSolDown, !digitalRead(FLDown));
 digitalWrite(FRSolUp, !digitalRead(FRUp));
 digitalWrite(FRSolDown, !digitalRead(FRDown));
 digitalWrite(RLSolUp, !digitalRead(RLUp));
 digitalWrite(RLSolDown, !digitalRead(RLDown));
 digitalWrite(RRSolUp, !digitalRead(RRUp));
 digitalWrite(RRSolDown, !digitalRead(RRDown));
 //All UP
 if (digitalRead(allUp) == LOW)
 {
   digitalWrite (FLSolUp, HIGH);
   digitalWrite (FRSolUp, HIGH);
   digitalWrite (RLSolUp, HIGH);
   digitalWrite (RRSolUp, HIGH);
    }
 else
 {
   digitalWrite (FLSolUp, LOW);
   digitalWrite (FRSolUp, LOW);
   digitalWrite (RLSolUp, LOW);
   digitalWrite (RRSolUp, LOW);
 }
 //All down
 if (digitalRead(allDown) == LOW)
{
 digitalWrite (FLSolDown, HIGH);
 digitalWrite (FRSolDown, HIGH); 
 digitalWrite (RLSolDown, HIGH); 
 digitalWrite (RRSolDown, HIGH); 
}
else
{
 digitalWrite (FLSolDown, LOW);
 digitalWrite (FRSolDown, LOW); 
 digitalWrite (RLSolDown, LOW); 
 digitalWrite (RRSolDown, LOW); 
}  
  ButtonState = digitalRead(RGBbut);

 if(ButtonState && (ButtonState != lastState))  // button latch, no debounce needed!!!!!
 {
   if(count < 6) // This will check to see if the count is within a range of 0 - 6, and anything over that, it will reset count back to 0. Of course, this will happen anyways because count is a BYTE, and not an int or any other type.
     count += 1; // same as count = count + 1;
   else
     count = 1;
   
 } 
 lastState = ButtonState;

 if(count==1)setColor(255, 255, 255);  // White  
 if(count==2)setColor(255, 255, 0);  // Yellow  
 if(count==3)setColor(100, 255, 0);  // Green  
 if(count==4)setColor(0, 255, 255);  // Aqua    
 if(count==5)setColor(80, 0, 80);  // Purple  
 if(count==6)setColor(0, 180, 80);  // Blue
 
 //storing color to eeprom
 if(ButtonState == LOW ) {
     EEPROM.write(10,count);
    }
 
 //Sensor FL #1
  raw = analogRead(sensor1);
  voltage = (float) raw / 1023.0 * 5.0;
  pressure = (((float)analogRead(sensor1) / 1023.0 * 5.0) - 0.5) * 37.5;
  
 
  dtostrf(pressure, 4, 0, buffer); // display pressure on glcd
  glcd.drawstring(0, 2, buffer);
  glcd.drawrect(30, 5, 6, 20, BLACK);
  BarFL(pressure); //call function
  
  if(pressure < 10){ 
    setColor(255, 0, 0);
   }   
  glcd.display();
}



void setColor(int red, int green, int blue)//RGB Color
{  
   red = 255 - red;
   green = 255 - green;
   blue = 255 - blue;
 
 analogWrite(redPin, red);
 analogWrite(greenPin, green);
 analogWrite(bluePin, blue);  
}


void BarFL(int value, int low, int high, int x, int y, int w, int h, int F_color, int B_color)
{
 static int lastV = -1, move = 0;
 int Val = map(value, low, high, 0, h-1);

 if (Val != lastV) // prevents it from constantly being redrawn on the screen
 {
   if ( Val > lastV)
   {
     for (move; move <= Val; move++)
     {
       glcd.drawline(x, y - move, w + 1, y - move, F_color);
     }
     glcd.display();
     lastV = Val;
   }
   else
   {
     for (move; move >= lastV; move--)
     {
       glcd.drawline(x, y - (move-1), w + 1, y - (move-1), B_color);
     }
     glcd.display();
   }
   lastV = Val;
 } 
}

Well, you've got code that turns on individual lights based on their corresponding button push alright. But right after that you check button 9 and if it is not pressed you turn those LEDs off in the else clause. Same with button 10. So they're actually coming on and you're turning them right back off. You need to check that there isn't another button pushed somewhere before you make that decision to write those leds low in the else part of the code for button 9 and button 10.

Ok.
So how come if i trow away the code from where it starts sensors and rgb and bar all those buttons works well.

//Front panel control
#include "ST7565.h"
#include <EEPROM.h>

//▼ Inputs Pins
const int FLUp = 30;
const int FLDown = 31;
const int FRUp = 32;
const int FRDown = 33;
const int RLUp =34;
const int RLDown = 35;
const int RRUp = 36;
const int RRDown = 37;
const int allUp = 40;
const int allDown = 41;
const int autoAllUp = 48;
const int autoAllDown = 49;
//▼Outputs Pins
const int FLSolUp = 22;
const int FLSolDown = 23;
const int FRSolUp = 24;
const int FRSolDown = 25;
const int RLSolUp = 26;
const int RLSolDown = 27;
const int RRSolUp = 28;
const int RRSolDown = 29;
//▼Sensor Inputs
int sensor1 = A0;
int sensor2 = A1;
int sensor3 = A2;
int sensor4 = A4;
int sensor5 = A5;
//▼RGB
int redPin = 12;
int greenPin = 11;
int bluePin = 10;
const byte RGBbut = 52;
byte ButtonState;
byte lastState = LOW;
byte count = 0;
//▼Other
char Val[5]; 
char buffer[5];
int raw;
float voltage;
float pressure; //Pressure PSI


ST7565 glcd(9, 8, 7, 6, 5);

#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 

// a bitmap of a KRONE icon
static unsigned char __attribute__ ((progmem)) logo16_glcd_bmp[]={
0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0xf8, 0xbe, 0x9f, 0xff, 0xf8, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 
0x20, 0x3c, 0x3f, 0x3f, 0x1f, 0x19, 0x1f, 0x7b, 0xfb, 0xfe, 0xfe, 0x07, 0x07, 0x07, 0x03, 0x00, };

void BarFL(int value = sensor1, int low = 0, int high = 150, int x = 30, int y = 24, int w = 33, int h = 19, int F_color =  BLACK, int B_color = WHITE); //Bargraph 1 FL

void setup()
{
 Serial.begin(9600);
 // initialize and set the contrast to 0x18
 glcd.begin(0x18);

 glcd.display(); // show Logo
 delay(2000);
 glcd.clear();
 
 //▼RGB

 count = EEPROM.read(10);
 pinMode(RGBbut, INPUT_PULLUP);
 pinMode(redPin, OUTPUT);
 pinMode(greenPin, OUTPUT);
 pinMode(bluePin, OUTPUT);     
 //▼Buttons
 pinMode(FLUp, INPUT_PULLUP);
 pinMode(FLDown, INPUT_PULLUP);
 pinMode(FRUp, INPUT_PULLUP);
 pinMode(FRDown, INPUT_PULLUP);
 pinMode(RLUp, INPUT_PULLUP);
 pinMode(RLDown, INPUT_PULLUP);
 pinMode(RRUp, INPUT_PULLUP);
 pinMode(RRDown, INPUT_PULLUP);
 pinMode(allUp, INPUT_PULLUP);
 pinMode(allDown, INPUT_PULLUP);
 pinMode(autoAllUp, INPUT_PULLUP);
 pinMode(autoAllDown, INPUT_PULLUP);
 pinMode(RGBbut, INPUT_PULLUP); 
 //▼Solenoids  
 pinMode(FLSolUp, OUTPUT);
 pinMode(FLSolDown, OUTPUT);
 pinMode(FRSolUp, OUTPUT);
 pinMode(FRSolDown, OUTPUT);
 pinMode(RLSolUp, OUTPUT);
 pinMode(RLSolDown, OUTPUT);
 pinMode(RRSolUp, OUTPUT);
 pinMode(RRSolDown, OUTPUT);
 //▼Pressure Sensors
 pinMode(sensor1, INPUT);
 pinMode(sensor2, INPUT);
 pinMode(sensor3, INPUT);
 pinMode(sensor4, INPUT);
 pinMode(sensor5, INPUT);
}

void loop()

{
//Single
 digitalWrite(FLSolUp, !digitalRead(FLUp));
 digitalWrite(FLSolDown, !digitalRead(FLDown));
 digitalWrite(FRSolUp, !digitalRead(FRUp));
 digitalWrite(FRSolDown, !digitalRead(FRDown));
 digitalWrite(RLSolUp, !digitalRead(RLUp));
 digitalWrite(RLSolDown, !digitalRead(RLDown));
 digitalWrite(RRSolUp, !digitalRead(RRUp));
 digitalWrite(RRSolDown, !digitalRead(RRDown));
 //All UP
 if (digitalRead(allUp) == LOW)
 {
   digitalWrite (FLSolUp, HIGH);
   digitalWrite (FRSolUp, HIGH);
   digitalWrite (RLSolUp, HIGH);
   digitalWrite (RRSolUp, HIGH);
    }
 else
 {
   digitalWrite (FLSolUp, LOW);
   digitalWrite (FRSolUp, LOW);
   digitalWrite (RLSolUp, LOW);
   digitalWrite (RRSolUp, LOW);
 }
 //All down
 if (digitalRead(allDown) == LOW)
{
 digitalWrite (FLSolDown, HIGH);
 digitalWrite (FRSolDown, HIGH); 
 digitalWrite (RLSolDown, HIGH); 
 digitalWrite (RRSolDown, HIGH); 
}
else
{
 digitalWrite (FLSolDown, LOW);
 digitalWrite (FRSolDown, LOW); 
 digitalWrite (RLSolDown, LOW); 
 digitalWrite (RRSolDown, LOW); 
}  
}

I removed the else from allup and alldown section an everything works fine now. Thank you.