Vu meter what is wrong

2 days i am fighting to solve my problem, i want to make a vu meter, with double options.
i have 14 leds, 7 leds for each deck A and deck B
the 7 leds shows’ the deckA song amplitude and the other 7 shows the deck B song amplitude

when arduino receive the midi ch2 cotroller 12 with value value 0-7 the left deck vu meter is active
when arduino receive the midi ch2 controller 13 with value value 0-7 the right deck vu meter is active
so far i manage to do it and is working perfect.

what i am trying to do is when i press a button to change the status and instate the leds to indicate the vu meter for deck A and deck B ,to indiacate main output, left and right channel

when arduino receive the midi ch2 cotroller 14 with value value 0-7 left channel leds
when arduino receive the midi ch2 cotroller 15 with value value 0-7 right channel leds

i cant do that what im doing wrong, please help me.

this is the error code

Traktorino__play_with_leds_no_compile:82:1: error: expected unqualified-id before 'else'

 else {

 ^~~~

Traktorino__play_with_leds_no_compile:163:1: error: expected unqualified-id before 'if'

 if (number == 13) {

 ^~

Traktorino__play_with_leds_no_compile:229:1: error: 'VUbuttonvalue' does not name a type

 VUbuttonvalue = value;

 ^~~~~~~~~~~~~

Traktorino__play_with_leds_no_compile:315:1: error: expected unqualified-id before 'if'

 if (number == 15) {

 ^~

Traktorino__play_with_leds_no_compile:382:1: error: 'VUbuttonvalue' does not name a type

 VUbuttonvalue = value;

 ^~~~~~~~~~~~~

exit status 1

expected unqualified-id before 'else'

this is my code


const int ShiftPWM_latchPin = 8;
#define SHIFTPWM_NOSPI
const int ShiftPWM_dataPin = 11;
const int ShiftPWM_clockPin = 12;

const bool ShiftPWM_invertOutputs = false;
const bool ShiftPWM_balanceLoad = false;

/////////////////////////////////////////////
// LIBRARIES
#include <ShiftPWM.h>  // Bit shifter library >> https://github.com/elcojacobs/ShiftPWM - include ShiftPWM.h after setting the pins!
// If using with ATmega328 - Uno, Mega, Nano...
#include <MIDI.h> // MIDI library (by Forty Seven Effects) >> https://github.com/FortySevenEffects/arduino_midi_library/releases/tag/4.3.1
MIDI_CREATE_DEFAULT_INSTANCE();

/////////////////////////////////////////////
// midi
byte midiCh = 1; // *Canal midi a ser utilizado
byte note = 36; // *Nota mais grave que sera utilizada
byte cc = 1; // *CC mais baixo que sera utilizado

/////////////////////////////////////////////
// Leds
const byte ledNum = 24; // total number of leds used
unsigned char maxBrightness = 255;
unsigned char pwmFrequency = 75;
unsigned int numRegisters = 3;
unsigned int numOutputs = numRegisters * 8;
unsigned int numRGBLeds = numRegisters * 8 / 3;
unsigned int fadingMode = 0; //start with all LED's off.

unsigned int VuL[7] = {1, 2, 3, 4, 5, 6, 7}; // VU left pins  MULTIPLEXER PINS
unsigned int VuR[7] = {15, 14, 13, 12, 11, 10, 9}; // VU righ pins  MULTIPLEXER PINS

unsigned int red = 180;
unsigned int green = 255;
unsigned int blue = 10;
unsigned int yellow = 100;

//////////////////////////////////////////////
//button
#define VUbutton 10   // BUTTON ON PIN 10
int value1_ = 0;      // TO HOLD THE OLD BUTTON STATE
int old = 0;          // TO HOLD THE LAST STATE
int VUbuttonvalue = 0; 


/////////////////////////////////////////////
void setup() {

  Serial.begin(115000);

  MIDI.turnThruOff();
  pinMode (VUbutton, INPUT_PULLUP ); //PIN 10 IS INPUTT

  /////////////////////////////////////////////
  // Midi in
  MIDI.setHandleControlChange(VUmeter_main);
  MIDI.setHandleControlChange(VUmeter);


  // Sets the number of 8-bit registers that are used.
  ShiftPWM.SetAmountOfRegisters(numRegisters);
  ShiftPWM.SetAll(0);
  // Sets the number of 8-bit registers that are used.
  ShiftPWM.SetAmountOfRegisters(numRegisters);
  ShiftPWM.SetPinGrouping(1); //This is the default, but I added here to demonstrate how to use the funtion
  ShiftPWM.Start(pwmFrequency, maxBrightness);
}

void loop() {
  MIDI.read();
  VUbuttonvalue = digitalRead (VUbutton);  //WHEN THE BUTTOS IS PRESS I WANT TO CHOOSE THE VUMETER (RIGHT AND LEFT)
  if (VUbuttonvalue == 1) {                
    delay(50);
    VUbuttonvalue = digitalRead (VUbutton);
    if (VUbuttonvalue == 0) {
      value1_ = old + 1;
    }
  }
}
else {
  delay (500);
}

////////////////////////////////////////////
//VU METER LEFT CD PLAYER

void VUmeter(byte channel, byte number, byte value) {
  int value1_ = value;
  if (value1_ != VUbuttonvalue) {
    // Left VU
    if (number == 12) {

      switch (value1_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          ShiftPWM.SetOne(VuL[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          ShiftPWM.SetOne(VuL[6], red);
          break;
      }
    }
  }
}
// VUMETER RIGHT CDPLAYER
if (number == 13) {
  switch (value1_) {
    case 0:
      for (int i = 0; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      break;
    case 1:
      for (int i = 1; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      ShiftPWM.SetOne(VuR[0], green);
      break;
    case 2:
      for (int i = 2; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 2; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 3:
      for (int i = 3; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 3; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 4:
      for (int i = 4; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 4; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 5:
      for (int i = 5; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 6:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      break;
    case 7:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      ShiftPWM.SetOne(VuR[6], red);
      break;
  }
}
VUbuttonvalue = value;


////////////////////////////////////////////
// led feedback  1

void VUmeter_main (byte channel, byte number, byte value) {

  //int value_ = round(map(value, 0, 127, 0, 7));
  int value_ = value;

  if (value_ != VUbuttonvalue) {

    if (number == 14) {

      switch (value_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          ShiftPWM.SetOne(VuL[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          ShiftPWM.SetOne(VuL[6], red);
          break;
      }
    }
  }
}

////////////////////////////////////////////
// led feedback  1

if (number == 15) {

  switch (value_) {
    case 0:
      for (int i = 0; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      break;
    case 1:
      for (int i = 1; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      ShiftPWM.SetOne(VuR[0], green);
      break;
    case 2:
      for (int i = 2; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 2; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 3:
      for (int i = 3; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 3; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 4:
      for (int i = 4; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 4; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 5:
      for (int i = 5; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 6:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      break;
    case 7:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      ShiftPWM.SetOne(VuR[6], red);
      break;
  }
}
VUbuttonvalue = value;

Arduino: 1.8.13 (Windows 10), Board: “Arduino Uno”

Auto Format your code in the IDE and you will see that you have code not in a function after the end of the VUmeter() function

      }
    }
  }
}
// VUMETER RIGHT CDPLAYER
if (number == 13)
{
  switch (value1_)

hi, i am trying to make a VUmeter, with 2 states. (vumeter) and (vumeter_main)
i need by default to be active the (vumeter) and when i press the button to active (vumeter_main) and cancel the (vumeter) and when press it again to stop the one and start the other…
but unfortunately i cant manage it… lot of error.

if(VUbuttonvaleu !=0){      //I DONT KNOW WHAT TO DO NEXT SO WHEN BUTTON IS PRESS IT WILL ACTIVATE (VUmeter)
                            //  and when press again it will deactivate VUmeter and activate 
}
  
}
const int ShiftPWM_latchPin = 8;
#define SHIFTPWM_NOSPI
const int ShiftPWM_dataPin = 11;
const int ShiftPWM_clockPin = 12; 

const bool ShiftPWM_invertOutputs = false;
const bool ShiftPWM_balanceLoad = false;

/////////////////////////////////////////////
// LIBRARIES
#include <ShiftPWM.h>  // Bit shifter library >> https://github.com/elcojacobs/ShiftPWM - include ShiftPWM.h after setting the pins!
// If using with ATmega328 - Uno, Mega, Nano...
#include <MIDI.h> // MIDI library (by Forty Seven Effects) >> https://github.com/FortySevenEffects/arduino_midi_library/releases/tag/4.3.1
MIDI_CREATE_DEFAULT_INSTANCE();

/////////////////////////////////////////////
// midi
byte midiCh = 1; // *Canal midi a ser utilizado
byte note = 36; // *Nota mais grave que sera utilizada
byte cc = 1; // *CC mais baixo que sera utilizado

int ccLastValue = 0;

/////////////////////////////////////////////
// Leds
const byte ledNum = 24; // total number of leds used
unsigned char maxBrightness = 255;
unsigned char pwmFrequency = 75;
unsigned int numRegisters = 3;
unsigned int numOutputs = numRegisters * 8;
unsigned int numRGBLeds = numRegisters * 8 / 3;
unsigned int fadingMode = 0; //start with all LED's off.

unsigned int VuL[7] = {1, 2, 3, 4, 5, 6, 7}; // VU left pins
unsigned int VuR[7] = {15, 14, 13, 12, 11, 10, 9}; // VU righ pins

unsigned int red = 180;
unsigned int green = 255;
unsigned int blue = 10;
unsigned int yellow = 100;

//////////////////////////////////////////////
//button
int VUbuttonvalue = 0;
int Vubutton = 10;

/////////////////////////////////////////////
void setup() {

  Serial.begin(115000); 
  
  MIDI.turnThruOff();
  pinMode (Vubutton, INPUT_PULLUP );
   
  /////////////////////////////////////////////
  // Midi in
  MIDI.setHandleControlChange(Vumeter_main);
  MIDI.setHandleControlChange(VUmeter);

   
  // Sets the number of 8-bit registers that are used.
  ShiftPWM.SetAmountOfRegisters(numRegisters);
  ShiftPWM.SetAll(0);
  // Sets the number of 8-bit registers that are used.
  ShiftPWM.SetAmountOfRegisters(numRegisters);
SetPinGrouping(4).
  ShiftPWM.SetPinGrouping(1); //This is the default, but I added here to demonstrate how to use the funtion
  ShiftPWM.Start(pwmFrequency, maxBrightness);
}

void loop() {
    MIDI.read();
    VUbuttonvalue =digitalRead (vubutton);    

    if(VUbuttonvaleu !=0){      //I DONT KNOW WHAT TO DO NEXT SO WHEN BUTTON IS PRESS IT WILL ACTIVATE (VUmeter)
                                //  and when press again it will deactivate VUmeter and activate 
    }
      
    }
    
}

////////////////////////////////////////////
void VUmeter(byte channel, byte number, byte value) {

    int value_ = value;

  if (value_ != ccLastValue) {

    // Left VU
    if (number == 14) {

      switch (value_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          ShiftPWM.SetOne(VuL[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          ShiftPWM.SetOne(VuL[6], red);
          break;
      }
    }

////////////////////////////////////////////
// led feedback  1

void VUmeter_main (byte channel, byte number, byte value) {    

    //int value_ = round(map(value, 0, 127, 0, 7));
  int value_ = value;

  if (value_ != ccLastValue) {

       if (number == 13) {

      switch (value_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          ShiftPWM.SetOne(VuL[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          ShiftPWM.SetOne(VuL[6], red);
          break;
      }
    }
 ////////////////////////////////////////////
// led feedback  1
    
    if (number == 13) {

      switch (value_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          ShiftPWM.SetOne(VuR[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuR[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuR[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuR[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuR[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuR[i], green);
          }
          ShiftPWM.SetOne(VuR[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuR[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuR[i], green);
          }
          ShiftPWM.SetOne(VuR[5], yellow);
          ShiftPWM.SetOne(VuR[6], red);
          break;
      }
    }
    ccLastValue = value;
  }

}

Arduino: 1.8.13 (Windows 10), Board: “Arduino Uno”



C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino\Traktorino.ino: In function 'void setup()':

Traktorino:58:31: error: 'Vumeter_main' was not declared in this scope

   MIDI.setHandleControlChange(Vumeter_main);

                               ^~~~~~~~~~~~

Traktorino:59:31: error: 'VUmeter' was not declared in this scope

   MIDI.setHandleControlChange(VUmeter);

                               ^~~~~~~

C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino\Traktorino.ino: In function 'void loop()':

Traktorino:75:33: error: 'vubutton' was not declared in this scope

     VUbuttonvalue =digitalRead (vubutton);

                                 ^~~~~~~~

C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino\Traktorino.ino:75:33: note: suggested alternative: 'Vubutton'

     VUbuttonvalue =digitalRead (vubutton);

                                 ^~~~~~~~

                                 Vubutton

Traktorino:77:8: error: 'VUbuttonvaleu' was not declared in this scope

     if(VUbuttonvaleu !=0){      //I DONT KNOW WHAT TO DO NEXT SO WHEN BUTTON IS PRESS IT WILL ACTIVATE (VUmeter)

        ^~~~~~~~~~~~~

C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino\Traktorino.ino:77:8: note: suggested alternative: 'VUbuttonvalue'

     if(VUbuttonvaleu !=0){      //I DONT KNOW WHAT TO DO NEXT SO WHEN BUTTON IS PRESS IT WILL ACTIVATE (VUmeter)

        ^~~~~~~~~~~~~

        VUbuttonvalue

C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino\Traktorino.ino: At global scope:

Traktorino:83:1: error: expected declaration before '}' token

 }

 ^

exit status 1

'Vumeter_main' was not declared in this scope



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You have a missing } (or two) at the end of VUmeter()

This shows up well if you Auto Format the code in the IDE

can u please fix for me… i have hours reading e.t.c to solve it

but also what i should write in the following lines? no idea

if(VUbuttonvaleu !=0){      //I DONT KNOW WHAT TO DO NEXT SO WHEN BUTTON IS PRESS IT WILL ACTIVATE (VUmeter)
                            //  and when press again it will deactivate VUmeter and activate 
}

Try Auto Format. The problem shows up where the VUmeter_main() function does not start on the left margin

Put two } on the end of the VUmeter() function, but note that there may be other problems

no idea how to fix it, am totally new in this.

As I said

nop my friend is worthless…

OK i found the problem, was the } you mention and and i write

MIDI.setHandleControlChange(Vumeter_main); // u was lowercase, was need U

MIDI.setHandleControlChange(VUmeter_main);

interest game programing but is for great nerves.
now what is the code for choosing the 2 function (VUmeter and VUmeter_main )
can some one help me please how i will write the code,???

void loop() {
  MIDI.read();
  VUbuttonvalue = digitalRead (vubutton);

  if (VUbuttonvaleu != 0) {   //I DONT KNOW WHAT TO DO NEXT SO WHEN BUTTON IS PRESS IT WILL ACTIVATE (VUmeter)
                              // and when press again it will deactivate VUmeter and activate
  }

I thought the code looked familiar

Topics on the same subject merged

@ tasoscy
Do not start new topics on the same subject. It wastes time

who you think i am a microsoft programer??? am very new
i pout } and that { what ever…

 ////////////////////////////////////////////
  //VU METER LEFT CD PLAYER

  void VUmeter(byte channel, byte number, byte value) {
    int value1_ = value;
    if (value1_ != VUbuttonvalue) {
      // Left VU
      if (number == 12) {

        switch (value1_) {
          case 0:
            for (int i = 0; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            break;
          case 1:
            for (int i = 1; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            ShiftPWM.SetOne(VuL[0], green);
            break;
          case 2:
            for (int i = 2; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            for (int i = 0; i < 2; i++) {
              ShiftPWM.SetOne(VuL[i], green);
            }
            break;
          case 3:
            for (int i = 3; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            for (int i = 0; i < 3; i++) {
              ShiftPWM.SetOne(VuL[i], green);
            }
            break;
          case 4:
            for (int i = 4; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            for (int i = 0; i < 4; i++) {
              ShiftPWM.SetOne(VuL[i], green);
            }
            break;
          case 5:
            for (int i = 5; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            for (int i = 0; i < 5; i++) {
              ShiftPWM.SetOne(VuL[i], green);
            }
            break;
          case 6:
            for (int i = 6; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            for (int i = 0; i < 5; i++) {
              ShiftPWM.SetOne(VuL[i], green);
            }
            ShiftPWM.SetOne(VuL[5], yellow);
            break;
          case 7:
            for (int i = 6; i < 7; i++) {
              ShiftPWM.SetOne(VuL[i], LOW);
            }
            for (int i = 0; i < 5; i++) {
              ShiftPWM.SetOne(VuL[i], green);
            }
            ShiftPWM.SetOne(VuL[5], yellow);
            ShiftPWM.SetOne(VuL[6], red);
            break;
        }
      }
    }
  }
}

C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino__play_with_leds\Traktorino__play_with_leds_no_compile\Traktorino__play_with_leds_no_compile.ino: In function 'void setup()':

Traktorino__play_with_leds_no_compile:59:31: error: 'VUmeter' was not declared in this scope

   MIDI.setHandleControlChange(VUmeter);

                               ^~~~~~~

C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino__play_with_leds\Traktorino__play_with_leds_no_compile\Traktorino__play_with_leds_no_compile.ino:59:31: note: suggested alternative: 'VUmeter_main'

   MIDI.setHandleControlChange(VUmeter);

                               ^~~~~~~

                               VUmeter_main

C:\Users\alina\Documents\traktorino-master\traktorino-master\Code\Traktorino__play_with_leds\Traktorino__play_with_leds_no_compile\Traktorino__play_with_leds_no_compile.ino: At global scope:

Traktorino__play_with_leds_no_compile:82:1: error: expected unqualified-id before 'else'

 else {

 ^~~~

Traktorino__play_with_leds_no_compile:85:1: error: expected unqualified-id before 'switch'

 switch (value1_) {

 ^~~~~~

Traktorino__play_with_leds_no_compile:166:1: error: expected unqualified-id before 'if'

 if (number == 13) {

 ^~

Traktorino__play_with_leds_no_compile:232:1: error: 'VUbuttonvalue' does not name a type

 VUbuttonvalue = value;

 ^~~~~~~~~~~~~

Traktorino__play_with_leds_no_compile:318:1: error: expected unqualified-id before 'if'

 if (number == 15) {

 ^~

Traktorino__play_with_leds_no_compile:385:1: error: 'VUbuttonvalue' does not name a type

 VUbuttonvalue = value;

 ^~~~~~~~~~~~~

exit status 1

'VUmeter' was not declared in this scope

You can’t just go spraying { and } around willy nilly. There is a logic to it

The { and } pairs are used to enclose a block of code, such as the code for a function. So, every function needs at least a { at the start and a } at the end. Inside the function there may be other code blocks such as if/while or for loops, but each opening { needs a corresponding } at the end of its code block

A common problem is for the closing } of a function to be missing, but the error message will not say that. Rather it reports a problem elsewhere in the code because the missing } makes a function definition include code that it should not.

Auto Formatting the code in the IDE should make all function definitions start on the left margin. If they don’t then the likely cause is a missing } prior to that point in the code

some thing else is the problem something i don’t do correct. i don’t know if i am correct to this part, i assume what i write is that if the button is press then the state will be 0 and will call the function … (((switch (value1_) {
case 1, 2, 3, 4, 5, 6, 7,: ))))))

switch (value1_) {
case 1, 2, 3, 4, 5, 6, 7,:
}

that will active this code and ignore the the second part
void VUmeter_main (byte channel, byte number, byte value) {

THIS IS THE SECOND PART OR FUNCTION
////////////////////////////////////////////
// led feedback  1

void VUmeter_main (byte channel, byte number, byte value) {
  int value_ = value;
  if (value_ != VUbuttonvalue) {
    if (number == 14) {
      switch (value_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
////////////////////////////////////////////
//VU METER LEFT CD PLAYER

void VUmeter(byte channel, byte number, byte value) {
  int value1_ = value;
  if (value1_ != VUbuttonvalue) {
    // Left VU
    if (number == 12) {

      switch (value1_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          ShiftPWM.SetOne(VuL[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          ShiftPWM.SetOne(VuL[6], red);
          break;
      }
    }
  }
}


// VUMETER RIGHT CDPLAYER
if (number == 13) {
  switch (value1_) {
    case 0:
      for (int i = 0; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      break;
    case 1:
      for (int i = 1; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      ShiftPWM.SetOne(VuR[0], green);
      break;
    case 2:
      for (int i = 2; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 2; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 3:
      for (int i = 3; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 3; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 4:
      for (int i = 4; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 4; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 5:
      for (int i = 5; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 6:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      break;
    case 7:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      ShiftPWM.SetOne(VuR[6], red);
      break;
  }
}

I don’t know what you have changed or whether you have a problem with errors when you compile the code or logic errors when the code is uploaded and runs

Take a step back

Post your complete code as it is now. If it does not compile then post the full error messages. If it does compile then describe the problem with how it runs. What should it do, what does it actually do ?

You have pushbutton inputs to your project. How are they wired ?

there’s an extra brace “}”

i think is correct, 2 on top and 2 on the bottom, dont know what you mean, to remove the brace from (( if (number == 13) { )) and to remove one in the end?



// VUMETER RIGHT CDPLAYER
if (number == 13) {
  switch (value1_) {
    case 0:
      for (int i = 0; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      break;
    case 1:
      for (int i = 1; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      ShiftPWM.SetOne(VuR[0], green);
      break;
    case 2:
      for (int i = 2; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 2; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 3:
      for (int i = 3; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 3; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 4:
      for (int i = 4; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 4; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 5:
      for (int i = 5; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 6:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      break;
    case 7:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      ShiftPWM.SetOne(VuR[6], red);
      break;
  }

}

I assume that is most of a function (why not all of it ?)

Are there an equal number of { and } in the function ?

this is the code and the error i dont know what to do else. is not the braces, something i write very wrong.

Traktorino__play_with_leds_no_compile:82:1: error: expected unqualified-id before 'else'

 else {

 ^~~~

Traktorino__play_with_leds_no_compile:86:1: error: expected unqualified-id before 'switch'

 switch (value1_) {

 ^~~~~~

Traktorino__play_with_leds_no_compile:170:1: error: expected unqualified-id before 'if'

 if (number == 13)

 ^~

Traktorino__play_with_leds_no_compile:239:1: error: 'VUbuttonvalue' does not name a type

 VUbuttonvalue = value;

 ^~~~~~~~~~~~~

Traktorino__play_with_leds_no_compile:325:1: error: expected unqualified-id before 'if'

 if (number == 15) {

 ^~

exit status 1

expected unqualified-id before 'else'

void loop() {
  MIDI.read();
  VUbuttonvalue = digitalRead (VUbutton);  //WHEN THE BUTTOS IS PRESS I WANT TO CHOOSE THE VUMETER (RIGHT AND LEFT)
  if (VUbuttonvalue == 0) {
    delay(50);
    VUbuttonvalue = digitalRead (VUbutton);
    if (VUbuttonvalue == 1) {
      value1_ = old + 1;
    }
  }
}
else {
  value1_ = old
            delay (500);
}
switch (value1_) {
case 1, 2, 3, 4, 5, 6, 7, :
  break;
}

////////////////////////////////////////////
//VU METER LEFT CD PLAYER

void VUmeter(byte channel, byte number, byte value) {
  int value1_ = value;
  if (value1_ != VUbuttonvalue) {
    // Left VU
    if (number == 12) {

      switch (value1_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          ShiftPWM.SetOne(VuL[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          ShiftPWM.SetOne(VuL[6], red);
          break;
      }
    }
  }
}


// VUMETER RIGHT CDPLAYER
if (number == 13)
  switch (value1_) {
    case 0:
      for (int i = 0; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      break;
    case 1:
      for (int i = 1; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      ShiftPWM.SetOne(VuR[0], green);
      break;
    case 2:
      for (int i = 2; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 2; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 3:
      for (int i = 3; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 3; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 4:
      for (int i = 4; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 4; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 5:
      for (int i = 5; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 6:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      break;
    case 7:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      ShiftPWM.SetOne(VuR[6], red);
      break;

  }



VUbuttonvalue = value;


////////////////////////////////////////////
// led feedback  1

void VUmeter_main (byte channel, byte number, byte value) {

  //int value_ = round(map(value, 0, 127, 0, 7));
  int value_ = value;

  if (value_ != VUbuttonvalue) {

    if (number == 14)

      switch (value_) {
        case 0:
          for (int i = 0; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          break;
        case 1:
          for (int i = 1; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          ShiftPWM.SetOne(VuL[0], green);
          break;
        case 2:
          for (int i = 2; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 2; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 3:
          for (int i = 3; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 3; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 4:
          for (int i = 4; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 4; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 5:
          for (int i = 5; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          break;
        case 6:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          break;
        case 7:
          for (int i = 6; i < 7; i++) {
            ShiftPWM.SetOne(VuL[i], LOW);
          }
          for (int i = 0; i < 5; i++) {
            ShiftPWM.SetOne(VuL[i], green);
          }
          ShiftPWM.SetOne(VuL[5], yellow);
          ShiftPWM.SetOne(VuL[6], red);
          break;
      }
  }
}


////////////////////////////////////////////
// led feedback  1

if (number == 15) {

  switch (value_) {
    case 0:
      for (int i = 0; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      break;
    case 1:
      for (int i = 1; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      ShiftPWM.SetOne(VuR[0], green);
      break;
    case 2:
      for (int i = 2; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 2; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 3:
      for (int i = 3; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 3; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 4:
      for (int i = 4; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 4; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 5:
      for (int i = 5; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      break;
    case 6:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      break;
    case 7:
      for (int i = 6; i < 7; i++) {
        ShiftPWM.SetOne(VuR[i], LOW);
      }
      for (int i = 0; i < 5; i++) {
        ShiftPWM.SetOne(VuR[i], green);
      }
      ShiftPWM.SetOne(VuR[5], yellow);
      ShiftPWM.SetOne(VuR[6], red);
      break;

  }
  VUbuttonvalue = value;