Skip to content

Commit 9696ddd

Browse files
authored
Merge pull request adafruit#959 from kattni/expand-if-else
Expand if/else.
2 parents d13eb41 + 6385ea0 commit 9696ddd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Circuit_Playground_Bluefruit_NeoPixel_Controller/Controller.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ def send_packet(uart_connection_name, packet):
8787
time.sleep(0.05) # Debounce.
8888
if cpb.switch is not last_switch_state: # If the switch state is changed...
8989
last_switch_state = cpb.switch # Set state to current switch state.
90-
print("Switch is to the", "left: LEDs off!" if cpb.switch else "right: LEDs on!")
90+
if cpb.switch:
91+
print("Switch is to the left: LEDs off!")
92+
else:
93+
print("Switch is to the right: LEDs on!")
9194
# Send a BUTTON_1 button packet.
9295
if not send_packet(uart_connection,
9396
ButtonPacket(ButtonPacket.BUTTON_1, pressed=cpb.switch)):

0 commit comments

Comments
 (0)