dtostrf limit output current?

Hi. Can someone explain how this code below possibly limit output current?
I have a fairly long code, checked all the pins 3 times to make sure they taged correctly.
State 0-8 are input buttons connected using internal PULLUP resistor.
When any one of them is pushed they barely light up, but without this code below they flash as they should.

State 9 and 10 turns 4 leds in one go with maximum current no matter if the dtostrf is included or not.

dtostrf(pressure, 4, 0, buffer); // display pressure on glcd
   glcd.drawstring(0, 2, buffer);
   glcd.drawrect(30, 5, 6, 20, BLACK);

the whole code below… sorry for pasting the whole lot.

//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()
{
  state1 = digitalRead(FLUp);
  if(state1 == LOW) {
  digitalWrite(FLSolUp, HIGH);
}
  else {
    digitalWrite(FLSolUp, LOW);
  }
  state2 = digitalRead(FLDown);
  if(state2 == LOW) {
    digitalWrite(FLSolDown, HIGH);
  }
  else {
    digitalWrite(FLSolDown, LOW);
  }
  state3 = digitalRead(FRUp);
  if(state3 == LOW) {
  digitalWrite(FRSolUp, HIGH);
}
  else {
    digitalWrite(FRSolUp, LOW);
  }
  state4 = digitalRead(FRDown);
  if(state4 == LOW) {
    digitalWrite(FRSolDown, HIGH);
  }
  else {
    digitalWrite(FRSolDown, LOW);
  }
  state5 = digitalRead(RLUp);
  if(state5 == LOW) {
  digitalWrite(RLSolUp, HIGH);
}
  else {
    digitalWrite(RLSolUp, LOW);
  }
  state6 = digitalRead(RLDown);
  if(state6 == LOW) {
    digitalWrite(RLSolDown, HIGH);
  }
  else {
    digitalWrite(RLSolDown, LOW);
  }
  state7 = digitalRead(RRUp);
  if(state7 == LOW) {
    digitalWrite(RRSolUp, HIGH);
}
  else {
    digitalWrite(RRSolUp, LOW);
  }
  state8 = digitalRead(RRDown);
  if(state8 == LOW) {
    digitalWrite(RRSolDown, HIGH);
  }
  else {
    digitalWrite(RRSolDown, LOW);
  }
  state9 = digitalRead(allUp);
  if(state9 == 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);
  }
  state10 = digitalRead(allDown);
  if(state10 == 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;
  } 
}

Thank you

dtostrf(pressure, 4, 0, buffer); // display pressure on glcd

I don't understand, in the least, why you are converting to float, and then printing with no digits after the decimal point. That's an int, damn it!

Ehm…i don’t know what to say.
So i can use glcd.drawstring(0, 2, pressure);?
But even that i’m still wondering why those leds are so limited.
I’ll get that sorted.

So i can use glcd.drawstring(0, 2, pressure);?

Not if pressure is a float unless the drawstring() method is overloaded to take a float, which I doubt.

But, then, pressure as a float makes no sense.

I don't know why that code seems to be causing your hardware problem, but I doubt that the code is causing the problem.

Why so many stateX variables ? All they are used for is to hold the state of an input which is then tested. You might just as well use the same variable for every digitalRead() or even do away with a variable altogether.

  if( digitalRead(FLUp) == LOW) 
  {
    digitalWrite(FLSolUp, HIGH);
  }
  else 
  {
    digitalWrite(FLSolUp, LOW);
  }

Or even

    digitalWrite(FLSolUp, !digitalRead(FLUp));

Thanks for suggestion UKHeliBob.