From 8ea6975718e1e5c9990a5a35013622a26bef65ef Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Sun, 26 Aug 2018 11:44:55 -0600 Subject: [PATCH] pylint is good to go --- .../NeoPixel_Basketball_Hoop-Point_Sensor.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop-Point_Sensor.py b/NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop-Point_Sensor.py index 2c89cb23..c61423df 100644 --- a/NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop-Point_Sensor.py +++ b/NeoPixel_Basketball_Hoop/NeoPixel_Basketball_Hoop-Point_Sensor.py @@ -10,7 +10,7 @@ ir_sensor = board.D2 basket_check_seconds = 0.1 numpix = 60 -# NeoPixel LED +# NeoPixel LED strip = neopixel.NeoPixel(pixpin, numpix, brightness=1, auto_write=False) # IR LED output for 38kHz PWM @@ -52,19 +52,19 @@ def timed_rainbow_cycle(seconds, wait): # Turn all the pixels off after the animation is done. for i in range(len(strip)): - strip[i] = (0,0,0) + strip[i] = (0,0,0) strip.show() def pulse_ir(): # enable IR LED - pwm.duty_cycle = (2 ** 16) - 1 - -def is_ball_in_hoop(): - # Check if the IR sensor picked up the pulse - pulse = decoder.read_pulses(pulses) - ir_sensor = (len(pulse)) + pwm.duty_cycle = (2 ** 16) - 1 - if ir_sensor == 0: +def is_ball_in_hoop(): + # Check if the IR sensor picked up the pulse + pulse = decoder.read_pulses(pulses) + ir_detect = (len(pulse)) + + if ir_detect == 0: return False # Sensor can see LED, return false. return True # Sensor can't see LED, return true.