Skip to content

Commit 75c1273

Browse files
committed
Linted
1 parent b9c45b5 commit 75c1273

5 files changed

Lines changed: 5 additions & 8 deletions

File tree

Hallowing_Lightsaber/lightsaber_standard/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def mix(color_1, color_2, weight_2):
110110
while True:
111111

112112
if TOUCH.value: # Capacitive pad touched?
113-
if MODE is 0: # If currently off...
113+
if MODE == 0: # If currently off...
114114
power('on', 1.7, False) # Power up!
115115
play_wav('idle', loop=True) # Play background hum sound
116116
MODE = 1 # ON (idle) mode now
@@ -131,7 +131,7 @@ def mix(color_1, color_2, weight_2):
131131
play_wav('hit') # Start playing 'hit' sound
132132
COLOR_ACTIVE = COLOR_HIT # Set color to fade from
133133
MODE = 3 # HIT mode
134-
elif MODE is 1 and ACCEL_SQUARED > SWING_THRESHOLD: # Mild = SWING
134+
elif MODE == 1 and ACCEL_SQUARED > SWING_THRESHOLD: # Mild = SWING
135135
TRIGGER_TIME = time.monotonic() # Save initial time of swing
136136
play_wav('swing') # Start playing 'swing' sound
137137
COLOR_ACTIVE = COLOR_SWING # Set color to fade from

Hallowing_Lightsaber/lightsaber_unicorn/code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def power(sound, duration, reverse):
163163
while True:
164164

165165
if TOUCH.value: # Capacitive pad touched?
166-
if MODE is 0: # If currently off...
166+
if MODE == 0: # If currently off...
167167
power('on', 3.0, False) # Power up!
168168
play_wav('idle', loop=True) # Play background hum sound
169169
MODE = 1 # ON (idle) mode now
@@ -184,7 +184,7 @@ def power(sound, duration, reverse):
184184
play_wav('hit') # Start playing 'hit' sound
185185
ACTIVE_ANIM = HIT_ANIM
186186
MODE = 3 # HIT mode
187-
elif MODE is 1 and ACCEL_SQUARED > SWING_THRESHOLD: # Mild = SWING
187+
elif MODE == 1 and ACCEL_SQUARED > SWING_THRESHOLD: # Mild = SWING
188188
TRIGGER_TIME = time.monotonic() # Save initial time of swing
189189
play_wav('swing') # Start playing 'swing' sound
190190
ACTIVE_ANIM = SWING_ANIM

Make_It_Hot_Cold/cold/code.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def show_value(time_val): # Show time on NeoPixels on CPX
1515
for i in range(num_pixels, 10):
1616
pixels[i] = (0, 0, 0)
1717
pixels.show()
18-
return
1918

2019
TMP36 = AnalogIn(board.A3) # TMP36 connected to A3, power & ground
2120
POT = AnalogIn(board.A7) # potentiometer connected to A7, power & ground
@@ -34,7 +33,7 @@ def show_value(time_val): # Show time on NeoPixels on CPX
3433
# between 0 and 1 is too short a time for a Peltier module
3534
if cool_value < 0.2:
3635
cool_value = 0.0
37-
if cool_value >= 0.2 and cool_value < 1.0:
36+
if 1.0 > cool_value >= 0.2:
3837
cool_value = 1.0
3938

4039
print((tempF, cool_value)) # Show in REPL

Make_It_Hot_Cold/hot/code.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def show_value(heat_val): # Show throttle on NeoPixels on CPX
1515
for i in range(num_pixels, 10):
1616
pixels[i] = (0, 0, 0)
1717
pixels.show()
18-
return
1918

2019
TMP36 = AnalogIn(board.A3) # TMP36 connected to A3, power & ground
2120
POT = AnalogIn(board.A7) # potentiometer connected to A7, power & ground

Make_It_Twist_Potentiometer/potentiometer-neopixels/code.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def show_value(val): # Show value 0-9 on CPX NeoPixels
1313
for i in range(val, NUMPIXELS):
1414
pixels[i] = (0, 0, 0)
1515
pixels.show()
16-
return
1716

1817
while True:
1918

0 commit comments

Comments
 (0)