gingemonster / pca9685-python-microbit Goto Github PK
View Code? Open in Web Editor NEWMicrobit Python Driver for PCA9685 16-Channel 12-bit PWM/Servo Driver - I2C interface
License: MIT License
Microbit Python Driver for PCA9685 16-Channel 12-bit PWM/Servo Driver - I2C interface
License: MIT License
I use mu editor, when I connect PCA9685 to microbit with slave address "0x41". The microbit gives me that "no module pca9685".
from microbit import sleep, i2c
import PCA9685
import servo
#PCA9685_ADDR = 0x41
#pwm = PCA9685.PCA9685(i2c)
pwm = PCA9685.PCA9685(i2c)
servo_min = 150 # Min pulse length out of 4096
servo_max = 600 # Max pulse length out of 4096:
pwm.set_pwm_freq(60)
print('Moving servo on channel 0, press Ctrl-C to quit...')
pwm.set_pwm(4, 0, servo_min)
sleep(1000)
pwm.set_pwm(4, 0, servo_max)
sleep(1000)
s0 = servo.Servos(i2c)
s0.position(0, 90)
sleep(1000)
s0.release(0)
First of all, thank you very much for your attention. Please help me solve this problem.
I brushed this program into micro:bit, micro:bit shows OSError, i2c.write error -1010.
Thank you very much。
In the module PCA9685.py
, in the duty()
definition, there is an attempt to use set_pwm()
without on and off arguments.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.