Fix pylint complaints
This commit is contained in:
parent
605d421c1b
commit
68ad7f7098
1 changed files with 3 additions and 6 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
# See https://en.wikipedia.org/wiki/PID_controller
|
import time
|
||||||
|
|
||||||
import busio
|
import busio
|
||||||
import board
|
import board
|
||||||
import time
|
|
||||||
from adafruit_seesaw.seesaw import Seesaw
|
from adafruit_seesaw.seesaw import Seesaw
|
||||||
from adafruit_seesaw.pwmout import PWMOut
|
from adafruit_seesaw.pwmout import PWMOut
|
||||||
from adafruit_motor import servo
|
from adafruit_motor import servo
|
||||||
|
|
@ -13,7 +11,7 @@ i2c = busio.I2C(board.SCL, board.SDA)
|
||||||
|
|
||||||
sensor = adafruit_lsm9ds0.LSM9DS0_I2C(i2c)
|
sensor = adafruit_lsm9ds0.LSM9DS0_I2C(i2c)
|
||||||
seesaw = Seesaw(i2c)
|
seesaw = Seesaw(i2c)
|
||||||
|
|
||||||
# Create servo objects
|
# Create servo objects
|
||||||
pwm1 = PWMOut(seesaw, 17)
|
pwm1 = PWMOut(seesaw, 17)
|
||||||
pwm1.frequency = 50
|
pwm1.frequency = 50
|
||||||
|
|
@ -31,11 +29,10 @@ while True:
|
||||||
y = -10
|
y = -10
|
||||||
if y > 10:
|
if y > 10:
|
||||||
y = 10
|
y = 10
|
||||||
|
|
||||||
# print(((y / 10) + 1) * 90)
|
# print(((y / 10) + 1) * 90)
|
||||||
|
|
||||||
# Set the angle
|
# Set the angle
|
||||||
servo1.angle = ((-y / 10) + 1) * 90
|
servo1.angle = ((-y / 10) + 1) * 90
|
||||||
|
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue