Hello All,
I’m trying to control a LED Strobe bar(picture Attached).
As you can see in the picture there’s 4 cables solder to the LED board.
These 4 cables control either the Amber or White side of the LEDs.
I’ve traced the cable points to PIN 5 of the LED drivers IC (BM0550HV).
I wrote this code up to control each color of the strobe.
everything seemed to work but now when I try to control the Amber side, my arduino Uno resets itself.
1 button to turn all amber LEDs on.
1 button to turn all white LEDs on.
1 button to turn all amber LEDs to strobes on.
1 button to turn all white LEDs to strobe on.
1 button to turn on different strobing patterns.
The only issue I’m encountering is that when pressing through the patterns I sometimes have to press the buttom more than once to switch to the next pattern
I’ve added my code and a fritzing design of how I wired the UNO with my breadboard.
const int buttonPin0 = 2; //Solid All Yellow LEDs
const int buttonPin1 = 3; //Solid All White LEDs
const int buttonPin2 = 4; //Strobe All Yellow LEDs
const int buttonPin3 = 5; //Strobe All White LEDs
const int buttonPin4 = 6; //Strobe Patterns
const int ledPin0 = 9; //First set of Yellow LEDs
const int ledPin1 = 10; //First set of White LEDs
const int ledPin2 = 11; //Second set of Yellow LEDs
const int ledPin3 = 12; //Second set of White LEDs
int buttonState0 = 0;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int oldState;
int buttonState4 = 0;
int state = 0;
unsigned long startTime;
unsigned long interval = 1000UL;
void setup() {
pinMode(ledPin0, OUTPUT);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(buttonPin0, INPUT);
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
pinMode(buttonPin4, INPUT);
}
void loop(){
buttonState0 = digitalRead(buttonPin0);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
if (buttonState0 == HIGH) { //Solid Yellow
SolidYellow();
}
if (buttonState1 == HIGH) { // Solid White
SolidWhite();
}
if (buttonState2 == HIGH) { //strobe yellow
FlashYellow();
}
if (buttonState3 == HIGH) { //strobe white
FlashWhite();
}
int buttonState4 = digitalRead(buttonPin4);
{
if (buttonState4 == HIGH)
{
if (oldState == LOW)
{
state++;
if (state > 12) state = 0;
}
}
}
oldState = buttonState4;
if (state == 0)
{
noFlash();
}
else if (state == 1)
{
flashA();
}
else if (state == 2)
{
flashB();
}
else if (state == 3)
{
flashC();
}
else if (state == 4)
{
flashD();
}
else if (state == 5)
{
flashE();
}
else if (state == 6)
{
flashF();
}
else if (state == 7)
{
flashG();
}
else if (state == 8)
{
flashH();
}
else if (state == 9)
{
flashI();
}
else if (state == 10)
{
flashJ();
}
else if (state == 11)
{
flashK();
}
else if (state == 12)
{
flashL();
}
}