programming code help

Hello all im new here trying to learn something New in the C++ world . I decide to tackle a project I wanted to do but im running in to some complying issues hopefully I can get it resovled and most importantly I learned . I hope I entered this code correctly. any insight would be great .

Im using an Arduino NANO to try and pull this off.
total leds running are 107 to my left and 107 to my right. :disappointed_relieved:

#include<FastLED.h>
#define LED_PIN 12
#define NUM_LEDS 107
int Button_Pin[] = {2, 3, 4, 5};


CRGB leds[NUM_LEDS];
void setup() {
  FastLED.addLeds<WS2812,LED_PIN, GRB>(leds, NUM_LEDS);
  pinMode(Button_Pin[0], INPUT_PULLUP); //turn signal left
  pinMode(Button_Pin[1], INPUT_PULLUP); //turn signal right
  pinMode(Button_Pin[2], INPUT_PULLUP); //BRAKE
  pinMode(Button_Pin[3], INPUT_PULLUP); //parking lights

}
void loop() {
  if (digitalRead(Button_Pin[0]) == HIGH)
  
    
  {

    leds[0] = CRGB(255, 0, 0);
    leds[1] = CRGB(255, 0, 0);
    leds[2] = CRGB(255, 0, 0);
    leds[3] = CRGB(255, 0, 0);
    leds[4] = CRGB(255, 0, 0);
    leds[5] = CRGB(255, 0, 0);
    leds[6] = CRGB(255, 0, 0);
    leds[7] = CRGB(255, 0, 0);
    leds[8] = CRGB(255, 0, 0);
    leds[9] = CRGB(255, 0, 0);
    leds[10] = CRGB(255, 0, 0);
    leds[11] = CRGB(255, 0, 0);
    leds[12] = CRGB(255, 0, 0);
    leds[13] = CRGB(255, 0, 0);
    leds[14] = CRGB(255, 0, 0);
    leds[15] = CRGB(255, 0, 0);
    leds[16] = CRGB(255, 0, 0);
    leds[17] = CRGB(255, 0, 0);
    leds[18] = CRGB(255, 0, 0);
    leds[19] = CRGB(255, 0, 0);
    leds[20] = CRGB(255, 0, 0);
    leds[21] = CRGB(255, 0, 0);
    leds[22] = CRGB(255, 0, 0);
    leds[23] = CRGB(255, 0, 0);
    leds[24] = CRGB(255, 0, 0);
    leds[25] = CRGB(255, 0, 0);
    leds[26] = CRGB(255, 0, 0);
    leds[27] = CRGB(255, 0, 0);
    leds[28] = CRGB(255, 0, 0);
    leds[29] = CRGB(255, 0, 0);
    leds[30] = CRGB(255, 0, 0);
    leds[31] = CRGB(255, 0, 0);
    leds[32] = CRGB(255, 0, 0);
     FastLed.show();
       leds[14] = CRGB(255, 255, 0);
     FastLed.show();
    Fastled.delay(40);
    {
    if (digitalRead[0] == HIGH{ //logical true 1}
    ELSE if (digitalRead[1] == HIGH) { //logical true 2}
        ELSE if (digitalRead[2] == HIGH) { //logical true 3)
          ElSE if (digitalRead[3] == HIGH) { //logical true 4)
            ELSE if (digitalRead[4] == HIGH) { //logical true 5)
              ELSE{logical false}
            }
          }
        }
      }

my error codes 'Fastled' not declared in this scope.

You haven't defined or declared an instance of the class FastLED

You have an unbalanced number of '{' and '}' brackets. There should be the same number of each.

Also, case matters:
FastLED
FastLed
Fastled
Are NOT the same thing.

Also:

digitalRead[0]

Perhaps you mean:

digitalRead(Button_Pin[0])

Also, typo on line 61. Missing ")" at end of

if (digitalRead[0] == HIGH{ //logical true 1}

^ here

 ELSE if

Is the else supposed to be upper case? Like gfvalvo says, case matters.

The autoformat tool in the IDE (ctrl-t or Tools, Auto Format) can help to point out missing or mismatched curly brackets and parenthesis. It will also help to see program flow and make the code easier for others to read and follow.

ok im going through all the info again and make correction, a lot of detail that I missed thank you all. when the corrections done do you think that it would functional? Meaning will that code achieve what I want it to do.

Try it and let us know.

ChrisPR:
Also, typo on line 61. Missing ")" at end of

if (digitalRead[0] == HIGH{ //logical true 1}

^ here

You're missing that the // causes a missing } as well.

-jim lee

Rafael030, Here's a suggestion for a structure I might start off with :slight_smile:

#include<FastLED.h>
#define LED_PIN 12
#define NUM_LEDS 107
#define COLOR_ORDER GRB 
#define LED_TYPE WS2812B

//  Define the Arduino pins the buttons are on
#define leftBut 2                           // Left turn
#define rightBut 3                          // Right turn
#define brakeBut 4                          // Brake
#define parkBut 5                           // Park
    
CRGB leds[NUM_LEDS];

void setup() 
{
        FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
        
        pinMode(leftBut,  INPUT_PULLUP);    // Pull up. means pin will be active LOW
        pinMode(rightBut, INPUT_PULLUP); 
        pinMode(brakeBut, INPUT_PULLUP);
        pinMode(parkBut,  INPUT_PULLUP);
}

void loop()                                 // MAIN LOOP
{
        if (digitalRead(leftBut)  == LOW) {left();}     
        if (digitalRead(rightBut) == LOW) {right();}
        if (digitalRead(brakeBut) == LOW) {brake();}
        if (digitalRead(parkBut)  == LOW) {park();}
}

                                            // "SUBROUTINES" 
void left()                             // Turn left routine
{
                                            // Hint: LOOK up "Non Blocking delays"
}
//+---

void right()                            // Turn right routine
{
                                            // Hint: LOOK up "Non Blocking delays"
}
//+---

void brake()                            // Brake routine
{
                                            // Hint: LOOK up "Non Blocking delays"
}
//+---

void park()                             // Park routine
{
                                            // Hint: LOOK up "Non Blocking delays"
}

Also some shorthand... Instead of individually assigning the LED values try

for (i=0; i<=32;i++){
LEDS[i]=CRGB(255,255,0);
}
FastLED.show;

Saves a lot of typing!

...and using FastLED.show(); saves a great deal of hair-loss.

TheMemberFormerlyKnownAsAWOL:
...and using FastLED.show(); saves a great deal of hair-loss.

Thanks for the correction.

In my defence I'm on a Huawei Mobile phone with "SwiftKey". It may be the only entity in the world that types worse gibberish than me.

It capitalises and adds spaces in email fields. I rest my case.