Motorcycle Led turn, run, brake lights.

This is my first project. I want to have two led strips mimic my turn signals/brake lights. I have two WS2812B with 24 led’s, Adafruit 5v Trinket. The led’s are set up in an array using pins 3 and 4. I want to use the signals from the bike to trigger the brake/ turn signals. On my motorcycle the turn signals and brake lights are always on for safety. When they are “active” the motorcycle lights appear go from half brightness to full brightness. I want the led strips to do the same, when the running light are on I want the brightness to be ½ of the max value. When the brakes or turn signals are active I want the led’s to toggle from half brightness to full brightness and not on and off like the blink sketch.
I was wanting to know how I could set up the brightness for half brightness and full brightness, and how I could use those values in an “if/else”.
I probably have more questions and have not realized them yet. If anyone sees any problems feel free to point them out. This is a learning experience for me.

// MultiArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
// using multiple controllers.  In this example, we're going to set up two WS2812B strips on two
// different pins, each strip getting its own CRGB array to be played with

#include <FastLED.h>

#define NUM_LEDS_PER_STRIP 24
#define LED_TYPE    WS2812B
int BRIGHTNESS =  127;
int fullBRIGHTNESS = 255; 
#define COLOR_ORDER GRB
#define FRAMES_PER_SECOND 60
#define leftPin  0  
#define rightPin  1
#define brakePin  2
CRGB leftLeds[NUM_LEDS_PER_STRIP];
CRGB rightLeds[NUM_LEDS_PER_STRIP];


// For mirroring strips, all the "special" stuff happens just in setup.  We
// just addLeds multiple times, once for each strip
void setup() {
 delay(3000); // sanity delay
 pinMode(leftPin, INPUT_PULLUP); //Input pin from left turn signal
 pinMode(rightPin, INPUT_PULLUP); //Input pin from right turn signal
 pinMode(brakePin, INPUT_PULLUP); //Input pin from brakes

  // tell FastLED there's 24 WS2812B leds on pin 3
  FastLED.addLeds<WS2812B, 3>(leftLeds, NUM_LEDS_PER_STRIP);

  // tell FastLED there's 24 WS2812B leds on pin 4
  FastLED.addLeds<WS2812B, 4>(rightLeds, NUM_LEDS_PER_STRIP);
  FastLED.setBrightness( BRIGHTNESS );

}

void loop() {
  for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    // set our current dot to red
    leftLeds[i] = CRGB::Red;
    rightLeds[i] = CRGB::Red;
    FastLED.show();
    // clear our current dot before we move on
    leftLeds[i] = CRGB::Black;
    rightLeds[i] = CRGB::Black;
    delay(100);
  }
if (digitalRead(leftPin) == LOW) {
    
}
else {
   
}
analogWrite(CRGB leftLeds, BRIGHTNESS);
delay( 50 );
}

if (digitalRead(rightPin) == low) {
   
}
else {
    
}
analogWrite(CRGB rightLeds, BRIGHTNESS);
delay( 50 );
}
if (digitalRead(brakePin) == LOW) {
    
}
else {
    
}
analogWrite(CRGB rightLeds, CRGB leftLeds. BRIGHTNESS);
delay( 50 );
}

 }

I was wanting to know how I could set up the brightness for half brightness and full brightness

Use a variable for brightness, not a #define statement.

and how I could use those values in an "if/else".

Like any other variable. I don't understand exactly what the problem is.

#define leftPin = 0;
#define rightPin = 1;
#define brakePin = 2;

#define statements do NOT have equal signs or semicolons. The preprocessor will substitute whatever follows the name as the value, wherever the name appears later in the code.

   pinMode(leftPin, INPUT_PULLUP);

would become

   pinMode(= 0;, INPUT_PULLUP);

which, of course, would not compile.

 digitalWrite(leftPin, HIGH);
 digitalWrite(rightPin, HIGH);
 digitalWrite(brakePin, HIGH);

You've already turned the pullup resistors on. This is useless code.

if (digitalRead(leftPin) == low) {

The keyword is LOW, not low.

    BRIGHTNESS == 255;

Comparing 127 to 255, without caring whether they are equal, or not, is pointless. You can't assign 255 to 127, so = is wrong, too.

Why didn't you even bother to compile this crap?

is this a proper way to configure the brightness for what i want?

thanks.

int BRIGHTNESS =  127;
int fullBRIGHTNESS = 255;

is this a proper way to configure the brightness for what i want?

I'd use partBrightness and fullBrightness, but that's only because I'm weird because I like related names to be the same length.

But, is that really what you want? I'd expect to have one variable, Brightness, that I could assign different values to, depending on whether the brake switch or turn signal switch was pressed.

PaulS:
But, is that really what you want? I'd expect to have one variable, Brightness, that I could assign different values to, depending on whether the brake switch or turn signal switch was pressed.

I do want one variable and assign different values to same as you described, how is that accomplished/ what would the code look like?

thank you.

I do want one variable and assign different values to same as you described, how is that accomplished/ what would the code look like?

int brightness = 127;


void loop()
{
   if(brakesOn() || turnSignalOn())
   {
      brightness = 255;
   }
   else
   {
      brightness = 127;
   }

   useBrightnessValue();
}

what are you attempting to do ? write to the ledstrip like this ?
analogWrite(CRGB rightLeds, BRIGHTNESS); check theDocumentation

I have cleaned up my sketch. the next thing i want to do is have leftPin, rightPin,
and brakePin to change the value of brightness like this

if leftPin goes LOW, I want leftLeds brightness to go from 127 to 255
(It should look like it is blinking, to match the turnsignal)
rightLeds stay at brightness 127.
if rightPin goes LOW, i want rightLeds brightness to go from 127 to 255
leftLeds stay at brightness 127
if brakePin goes LOW I want leftLeds and rightLeds brightness to go from 127 to 255

Is it clear what i am trying to do? could someone teach me how to do this and give an explaination on how to write the code?

thank you

// MultiArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
// using multiple controllers.
#include <FastLED.h>;
#define NUM_LEDS_PER_STRIP 24
#define LED_TYPE    WS2812B
#define BRIGHTNESS  127
#define COLOR_ORDER GRB
#define FRAMES_PER_SECOND 60
#define leftPin 3
#define rightPin 5
#define brakePin 6
CRGB leftLeds[NUM_LEDS_PER_STRIP];
CRGB rightLeds[NUM_LEDS_PER_STRIP];

// For mirroring strips, all the "special" stuff happens just in setup.  We
// just addLeds multiple times, once for each strip
void setup() {
 delay(3000); // sanity delay
 pinMode(leftPin, INPUT_PULLUP);
 pinMode(rightPin, INPUT_PULLUP);
 pinMode(brakePin, INPUT_PULLUP);
  // tell FastLED there's 24 WS2812B leds on pin 9
  FastLED.addLeds<WS2812B, 9>(leftLeds, NUM_LEDS_PER_STRIP);
  // tell FastLED there's 24 WS2812B leds on pin 10
  FastLED.addLeds<WS2812B, 10>(rightLeds, NUM_LEDS_PER_STRIP);
  FastLED.setBrightness( BRIGHTNESS );
}

void loop() {
  for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    // set our current strips to red
    leftLeds[i] = CRGB(0,255,0);
    rightLeds[i] = CRGB(0,255,0);
    FastLED.show();
  }
}

Yeah i think it is clear what your are trying to do. Let's ignore what you put within loop() for now, FastLed has a lot of cool functions build into it look hereUnfortunately they don't always do what you expect them to do. FastLED.setBrightness( BRIGHTNESS );sets the overall brightness to half as bright as maximum.
Anyway If you add a few lines at the end of setup() like this

FastLED.fill_solid(leftleds,24,CRGB(255,0,0);
FastLED.fill_solid(rightleds,24,CRGB(255,0,0);
FastLED.show();

this should make all your LEDS go red.