From acfaf852586f7c83386df44eee101c4ee7343d84 Mon Sep 17 00:00:00 2001 From: Jen Fox Date: Wed, 12 Dec 2018 12:11:32 -0800 Subject: [PATCH] Fixed index error, removed testArray --- PartyCircuits_MicroBit.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/PartyCircuits_MicroBit.py b/PartyCircuits_MicroBit.py index 552f32e..d1990c5 100644 --- a/PartyCircuits_MicroBit.py +++ b/PartyCircuits_MicroBit.py @@ -21,8 +21,6 @@ #Import all of the Micro:Bit Library from microbit import * -testArray = [1,1,1,1] #For testing purposes only - # Setup & Config display.off() # Turns off LEDs to free up additional input pins uart.init(baudrate=9600) # Sets serial baud rate @@ -148,7 +146,7 @@ def update_control_state(): if got_data: is_paused = parsedData[0] == "#pause" play_infinitely = parsedData[1] == "1" - commandArrayRaw = parsedData[2:] + commandArrayRaw = parsedData[2:10] #=============================================================================# @@ -159,7 +157,7 @@ while (True): update_control_state() if got_data or play_infinitely: - for command_index in range(len(commandArrayRaw)-1): + for command_index in range(len(commandArrayRaw)): # Leave for loop if we're paused if is_paused: break @@ -168,7 +166,6 @@ while (True): intensity = ledIntensity(intensity) flashSpeed = ledFlashSpeed(flashSpeed) - #uart is the micro:bit command for serial try: uart.write('{}{}'.format(command_index + 1, EOL)) @@ -179,7 +176,4 @@ while (True): ledFlashSequence(intensity, flashSpeed, ledCommandList) sleep(DATA_RATE) - update_control_state() - - - \ No newline at end of file + update_control_state() \ No newline at end of file