Skip to content

Micropython I2C device driver gebasseerd op Adafruit code.

Notifications You must be signed in to change notification settings

pappavis/micropython-pca9685

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Micropython PCA9685 12-bit I2C PWM motor aansturing biblioteek. Oorspronklike deur Adafruit

Installatie

  1. Download die micropython lib
macBook$ git pull github.com/pappavis/micropython-pca9685/
  1. Verbind jouw Micropython apparaat aan jouw computer.
  2. Open Thonny en selecteer die juiste COM-poort (Windows) of /dev/ op Mac & Linux.
  3. Maak een root map "lib"

5. Upload die lib naar /lib/pca9685 met 'n tool soos mpfshell. 6. Test jouw installasie

Gebruik:

Jy kan die Micropython REPL oopmaak en die volgende intik.

MicroPython v1.13-178-g21c293fbc on 2020-11-16; ESP32 module with ESP32

Type "help()" for more information.
>>> from pca9685.pca9685 import PCA9685
>>> import machine
>>> i2c1 = machine.SoftI2C(scl=machine.Pin(22),sda=machine.Pin(21),freq=100000)
>>> moto1 = DCMotors(i2c=i2c1, address=0x40)
>>> moto1.__DC_MOTORS = [(14, 15), (8, 9)]
>>> moto1.speed(index=0, value=1200)
>>> moto1.speed(index=0, value=0)

Let op!! met __DC_MOTORS = [(14, 15)] stel jy jouw poorten in as array.

voorbeeld DCMotors

Sien ook die examples/ map vir meer voorbeelde.

Credits

Oorspronklike lib deur Adafruit. Aangepasd deur Michiel Erasmus.

About

Micropython I2C device driver gebasseerd op Adafruit code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages