From 6385ea09d270b81ba33c7bea4afb447958786265 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 10 Dec 2019 14:49:22 -0500 Subject: [PATCH] Expand if/else. --- .../Controller.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Circuit_Playground_Bluefruit_NeoPixel_Controller/Controller.py b/Circuit_Playground_Bluefruit_NeoPixel_Controller/Controller.py index 416e6d085..da99a67d8 100755 --- a/Circuit_Playground_Bluefruit_NeoPixel_Controller/Controller.py +++ b/Circuit_Playground_Bluefruit_NeoPixel_Controller/Controller.py @@ -87,7 +87,10 @@ while True: time.sleep(0.05) # Debounce. if cpb.switch is not last_switch_state: # If the switch state is changed... last_switch_state = cpb.switch # Set state to current switch state. - print("Switch is to the", "left: LEDs off!" if cpb.switch else "right: LEDs on!") + if cpb.switch: + print("Switch is to the left: LEDs off!") + else: + print("Switch is to the right: LEDs on!") # Send a BUTTON_1 button packet. if not send_packet(uart_connection, ButtonPacket(ButtonPacket.BUTTON_1, pressed=cpb.switch)):