Spaces:
Sleeping
Sleeping
chore: Update RGB sliders to use a maximum power reduction
Browse files
app.py
CHANGED
|
@@ -25,10 +25,18 @@ PORT = st.number_input(
|
|
| 25 |
# User input for the Pico ID
|
| 26 |
pico_id = st.text_input("Enter your Pico ID:", "test", type="password")
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
# Sliders for RGB values
|
| 29 |
-
R = st.slider("Select the Red value:", min_value=0, max_value=
|
| 30 |
-
G = st.slider("Select the Green value:", min_value=0, max_value=
|
| 31 |
-
B = st.slider("Select the Blue value:", min_value=0, max_value=
|
| 32 |
|
| 33 |
# Initialize session state for messages
|
| 34 |
if "messages" not in st.session_state:
|
|
|
|
| 25 |
# User input for the Pico ID
|
| 26 |
pico_id = st.text_input("Enter your Pico ID:", "test", type="password")
|
| 27 |
|
| 28 |
+
max_power = 0.3
|
| 29 |
+
max_value = round(max_power * 255)
|
| 30 |
+
|
| 31 |
+
# Information about the maximum power reduction
|
| 32 |
+
st.info(
|
| 33 |
+
f"The maximum power has been reduced (NeoPixels can get very bright 😎). The upper limit for RGB values is {max_value} instead of 255."
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
# Sliders for RGB values
|
| 37 |
+
R = st.slider("Select the Red value:", min_value=0, max_value=max_value, value=0)
|
| 38 |
+
G = st.slider("Select the Green value:", min_value=0, max_value=max_value, value=0)
|
| 39 |
+
B = st.slider("Select the Blue value:", min_value=0, max_value=max_value, value=0)
|
| 40 |
|
| 41 |
# Initialize session state for messages
|
| 42 |
if "messages" not in st.session_state:
|