The BD-1 Logics board is designed for Michael Baddeleys BD-1.
It fits the head and is controlled via a piggyback Arduino Pro mini or via any other microcontroller.
It has 251 3535 RGB Leds.
Available at shop.printed-droid.com
BD-1 Logic Panel Manual and Description
1. Overview
This sketch is designed for a BD-1 Droid Logic Panel, powered by an Arduino Pro Mini 5V and using the BD1 Board.
The sketch allows for extensive control over the LED display, including color modes, brightness levels, fade effects, and EEPROM-based settings storage.
- LEDs: 251 WS2812B RGB LEDs
- Serial Baud Rate: 9600
2. Features
EEPROM Support: Saves configuration settings to EEPROM, allowing settings to persist across resets.
Color Modes: 14 predefined colors, including a random color mode and a multicolor mode for varied displays.
Brightness Control: Adjustable minimum and maximum brightness levels, with options for a uniform brightness or random brightness per LED.
Fade Effect: Configurable fade effect for smooth transitions between colors.
3. Configurable Variables:
Color Mode:
- Variable:
colorMode
- Command:
color [mode]
- Description: Changes the color mode. Available modes are:
blue
red
yellow
green
purple
pink
multicolor
random
(picks a random single color for all LEDs)cyan
orange
lime
magenta
white
Blink Speed:
- Variable:
blinkSpeed
- Command:
blinkSpeed [milliseconds]
- Description: Sets the blink speed (delay between updates) in milliseconds.
- Range: Any integer value representing milliseconds.
Fade Effect:
- Variable:
enableFade
- Command:
fade [on/off]
- Description: Enables or disables the fading effect for transitions between color changes.
Same Brightness for All LEDs:
- Variable:
sameBrightness
- Command:
sameBrightness [on/off]
- Description: When enabled, all LEDs have the same brightness. When disabled, each LED can have a different brightness.
Minimum Brightness:
- Variable:
minBrightness
- Command:
minBrightness [value]
- Description: Sets the minimum brightness level for LEDs.
- Range: 0-255
Maximum Brightness:
- Variable:
maxBrightness
- Command:
maxBrightness [value]
- Description: Sets the maximum brightness level for LEDs.
- Range: 0-255
- LED On/Off State:
- Variable:
isOn
- Command:
on
oroff
- Description: Turns the LEDs on or off.
EEPROM Storage Variables:
These settings are saved to EEPROM and can be loaded or saved:
colorMode
blinkSpeed
enableFade
sameBrightness
minBrightness
maxBrightness
isOn
Non-Configurable Variables:
- NUM_LEDS: Defines the number of LEDs in the strip (constant).
- DEFAULT_BRIGHTNESS: Sets the default brightness level when
sameBrightness
is enabled.
4. Via sketch configurable Variables:
- LED Configuration:
- LED_PIN: The pin connected to the BD-1 Board. Default is set to
10
. - NUM_LEDS: Total number of LEDs in the strip. This is set to
251
but can be adjusted if you have a different number. - MAX_ACTIVE_LEDS: Sets the maximum number of LEDs that can light up at the same time. Default is
75
. - MIN_ACTIVE_LEDS: Sets the minimum number of LEDs that should light up at the same time. Default is
10
. - DEFAULT_BRIGHTNESS: Sets the default brightness level if
sameBrightness
is enabled. Default is128
(range: 0–255).
- LED_PIN: The pin connected to the BD-1 Board. Default is set to
5. Serial commands:
Here is the list of serial commands that can be used in your sketch:
Available Commands:
Change Color Mode:
- Command:
color [mode]
- Example:
color red
- Description: Changes the color mode. Available modes:
blue
red
yellow
green
purple
pink
multicolor
random
(picks a random single color for all LEDs)cyan
orange
lime
magenta
white
Set Blink Speed:
- Command:
blinkSpeed [milliseconds]
- Example:
blinkSpeed 500
- Description: Sets the blink speed in milliseconds (delay between updates).
Toggle Fade Effect:
- Command:
fade [on/off]
- Example:
fade on
- Description: Enables or disables the fade effect between color transitions.
Toggle Same Brightness for All LEDs:
- Command:
sameBrightness [on/off]
- Example:
sameBrightness on
- Description: When enabled, all LEDs have the same brightness. When disabled, each LED can have a different (random) brightness.
Set Minimum Brightness:
- Command:
minBrightness [value]
- Example:
minBrightness 10
- Description: Sets the minimum brightness level for LEDs (0-255).
Set Maximum Brightness:
- Command:
maxBrightness [value]
- Example:
maxBrightness 200
- Description: Sets the maximum brightness level for LEDs (0-255).
Turn LEDs On:
- Command:
on
- Description: Turns on the LEDs.
Turn LEDs Off:
- Command:
off
- Description: Turns off the LEDs and clears the strip.
Save Settings to EEPROM:
- Command:
save
- Description: Saves the current configuration (color mode, brightness, etc.) to EEPROM.
- Clear EEPROM:
- Command:
clear
- Description: Clears all stored data in the EEPROM.
- Command:
- Check Current Status:
- Command:
status
- Description: Prints the current settings including color mode, brightness levels, fade status, and on/off status.
- Command:
Send commands in lowercase without additional formatting.
Command | Description | Example |
---|---|---|
color [mode] | Sets the color mode. Available modes: blue, red, yellow, green, purple, pink, cyan, orange, lime, magenta, white, multicolor, random. | color green |
blinkSpeed [value] | Sets the blink speed in milliseconds. | blinkSpeed 300 |
fade [on/off] | Enables or disables the fade effect. | fade on |
sameBrightness [on/off] | Sets all LEDs to the same brightness if enabled. | sameBrightness off |
minBrightness [value] | Sets minimum brightness for LEDs. | minBrightness 50 |
maxBrightness [value] | Sets maximum brightness for LEDs. | maxBrightness 200 |
on | Turns on the LEDs. | on |
off | Turns off the LEDs and clears the strip. | off |
save | Saves current configuration to EEPROM. | save |
clear | Clears all stored EEPROM data. | clear |
status | Prints current configuration settings. | status |
6. Example Usage
- Change Color Mode: To change the color mode to cyan, type:
color cyan
- Adjust Blink Speed: To set the blink speed to 200 milliseconds, type:
blinkSpeed 200
- Enable Fade: To enable the fade effect, type:
fade on
- Save Settings: To save the current configuration, type:
save