File tree Expand file tree Collapse file tree
Circuit_Playground_Bluefruiit_NeoPixel_Controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9393 elif isinstance (packet , ButtonPacket ): # If the packet is a button packet...
9494 # Check to see if it's BUTTON_1 (which is being sent by the slide switch)
9595 if packet .button == ButtonPacket .BUTTON_1 :
96- print ("Controller switch is to the" , "left: LEDs off!" if packet .pressed
97- else "right: LEDs on!" )
98- # If the controller switch is moved to the left...
96+ if packet .pressed : # If controller switch is to the left...
97+ print ("Controller switch is to the left: LEDs off!" )
98+ else : # If the controller switch is to the right...
99+ print ("Controller switch is to the right: LEDs on!" )
100+ # If the controller switch is moved from right to left...
99101 if packet .pressed and not blanked :
100102 animations .fill (color .BLACK ) # Turn off the LEDs.
101103 blanked = packet .pressed # Track the state of the slide switch.
You can’t perform that action at this time.
0 commit comments