Skip to content

Commit 44d18a3

Browse files
committed
Linted
1 parent 12f6866 commit 44d18a3

6 files changed

Lines changed: 14 additions & 19 deletions

File tree

  • CircuitPython_Simple_Wordclock/set_clock
  • Multitasking_with_CircuitPython

CircuitPython_Simple_Wordclock/set_clock/code.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
LED13 = digitalio.DigitalInOut(board.D13)
1616
LED13.direction = digitalio.Direction.OUTPUT
1717

18-
# pylint: disable-msg=bad-whitespace
1918
# pylint: disable-msg=using-constant-test
2019
if True:
2120
# year, mon, date, hour, min, sec, wday, yday, isdst
@@ -28,4 +27,3 @@
2827
print("Done!")
2928
LED13.value = True
3029
# pylint: enable-msg=using-constant-test
31-
# pylint: enable-msg=bad-whitespace

Multitasking_with_CircuitPython/code_all_together/code.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
used simultaneously without interrupting each other.
44
"""
55

6+
import time
67
import board
78
import digitalio
8-
import time
99
import neopixel
1010
import pwmio
1111
from adafruit_motor import servo
@@ -108,11 +108,11 @@
108108
prev_state = cur_state
109109

110110
for led in BLINK_LIST:
111-
if led["PIN"].value == False:
111+
if led["PIN"].value is False:
112112
if now >= led["PREV_TIME"] + led["OFF"]:
113113
led["PREV_TIME"] = now
114114
led["PIN"].value = True
115-
if led["PIN"].value == True:
115+
if led["PIN"].value is True:
116116
if now >= led["PREV_TIME"] + led["ON"]:
117117
led["PREV_TIME"] = now
118118
led["PIN"].value = False
@@ -131,6 +131,6 @@
131131
if servo["SERVO"].angle >= servo["MAX_ANGLE"] or \
132132
servo["SERVO"].angle <= servo["MIN_ANGLE"]:
133133

134-
servo["MOVE_BY"] = -servo["MOVE_BY"]
134+
servo["MOVE_BY"] = -servo["MOVE_BY"]
135135

136136
servo["PREV_TIME"] = now

Multitasking_with_CircuitPython/code_blink_and_servo/code.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
used simultaneously without interrupting each other.
44
"""
55

6+
import time
67
import board
78
import digitalio
8-
import time
99
import neopixel
1010
import pwmio
1111
from adafruit_motor import servo
@@ -67,11 +67,11 @@
6767
now = time.monotonic()
6868

6969
for led in BLINK_LIST:
70-
if led["PIN"].value == False:
70+
if led["PIN"].value is False:
7171
if now >= led["PREV_TIME"] + led["OFF"]:
7272
led["PREV_TIME"] = now
7373
led["PIN"].value = True
74-
if led["PIN"].value == True:
74+
if led["PIN"].value is True:
7575
if now >= led["PREV_TIME"] + led["ON"]:
7676
led["PREV_TIME"] = now
7777
led["PIN"].value = False
@@ -91,6 +91,6 @@
9191
if servo["SERVO"].angle >= servo["MAX_ANGLE"] or \
9292
servo["SERVO"].angle <= servo["MIN_ANGLE"]:
9393

94-
servo["MOVE_BY"] = -servo["MOVE_BY"]
94+
servo["MOVE_BY"] = -servo["MOVE_BY"]
9595

9696
servo["PREV_TIME"] = now

Multitasking_with_CircuitPython/code_multiple_leds/code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
rates simultaneously without each affecting the others.
44
"""
55

6+
import time
67
import board
78
import digitalio
8-
import time
99

1010
BLINK_LIST = [
1111
{
@@ -43,11 +43,11 @@
4343
now = time.monotonic()
4444

4545
for led in BLINK_LIST:
46-
if led["PIN"].value == False:
46+
if led["PIN"].value is False:
4747
if now >= led["PREV_TIME"] + led["OFF"]:
4848
led["PREV_TIME"] = now
4949
led["PIN"].value = True
50-
if led["PIN"].value == True:
50+
if led["PIN"].value is True:
5151
if now >= led["PREV_TIME"] + led["ON"]:
5252
led["PREV_TIME"] = now
5353
led["PIN"].value = False

Multitasking_with_CircuitPython/code_multiple_leds_cpb/code.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Circuit Playground Neopixels.
55
"""
66
import time
7-
import digitalio
8-
import board
97
from adafruit_circuitplayground import cp
108

119
BLINK_MAP = {
@@ -45,7 +43,7 @@
4543
# Store the current time to refer to later.
4644
now = time.monotonic()
4745

48-
for color in BLINK_MAP.keys():
46+
for color in BLINK_MAP.keys(): # pylint: disable=consider-iterating-dictionary
4947

5048
# Is LED currently OFF?
5149
if cp.pixels[BLINK_MAP[color]["INDEX"]] == (0, 0, 0):

Multitasking_with_CircuitPython/code_servo_without_sleep/code.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
time.sleep().
44
"""
55

6-
import board
7-
import digitalio
86
import time
7+
import board
98
import pwmio
109
from adafruit_motor import servo
1110

@@ -44,6 +43,6 @@
4443
if servo["SERVO"].angle >= servo["MAX_ANGLE"] or \
4544
servo["SERVO"].angle <= servo["MIN_ANGLE"]:
4645

47-
servo["MOVE_BY"] = -servo["MOVE_BY"]
46+
servo["MOVE_BY"] = -servo["MOVE_BY"]
4847

4948
servo["PREV_TIME"] = now

0 commit comments

Comments
 (0)