adafruit / Adafruit_CircuitPython_MotorKit

CircuitPython helper library for the DC & Stepper Motor FeatherWing, Shield and Pi Hat kits.
MIT License
86 stars 31 forks source link

Added example library #9

Closed zlite closed 5 years ago

zlite commented 5 years ago

Similar to Robot.py in previous Python Adafruit Motor Hat Library.

Also added a robot.steer function. Use form: robot.steer(speed, direction) where both speed and direction are +/- 0-1

ladyada commented 5 years ago

thanks! looks like there's a few pylint issues - https://travis-ci.com/adafruit/Adafruit_CircuitPython_MotorKit/builds/94101676 we're strict about PRs passing pylint, since it often finds bugs, if you're not sure how to fix these we can help!

************* Module Robot
C: 75, 0: Line too long (109/100) (line-too-long)
R: 19, 4: Too many arguments (7/5) (too-many-arguments)
W: 19,23: Unused argument 'addr' (unused-argument)
W: 19,34: Unused argument 'left_id' (unused-argument)
W: 19,45: Unused argument 'right_id' (unused-argument)
R: 56, 4: Method could be a function (no-self-use)
zlite commented 5 years ago

Not sure why the build is failing. It's been tested and works in the real world. All previous Travis complaints (all cosmetic) have been addressed

ladyada commented 5 years ago

ahhh the linter is picky - @kattni can take a look tomorrow, looks like the two warnings are minor!

dhalbert commented 5 years ago

@zlite pylint errors here: https://travis-ci.com/adafruit/Adafruit_CircuitPython_MotorKit/builds/94135005

zlite commented 5 years ago

Yeah, those linter complaints are silly:

C: 71, 0: Line too long (107/100) (line-too-long) R: 52, 4: Method could be a function (no-self-use)

dhalbert commented 5 years ago

You can just make line 52 be a @staticmethod.

zlite commented 5 years ago

I guess I could, but it's perfectly fine as it is, too. I think our linter friend is wrong in both these cases ;-)

I'm going to leave it here. If you like it, pull it! If not, no hard feelings

ladyada commented 5 years ago

no biggie - thanks for the PR @kattni tomorrow please merge 'n fix the 2 lints

ladyada commented 5 years ago

thanks @kattni !!