Giter Club home page Giter Club logo

pca9685-python-microbit's People

Contributors

gingemonster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pca9685-python-microbit's Issues

microbit pca9685

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

Initialise the PCA9685 using the default address (0x40).

#PCA9685_ADDR = 0x41
#pwm = PCA9685.PCA9685(i2c)
pwm = PCA9685.PCA9685(i2c)

Configure min and max servo pulse lengths (will need to adjust for different servos)

servo_min = 150 # Min pulse length out of 4096
servo_max = 600 # Max pulse length out of 4096:

Set frequency to 60hz, good for servos.

pwm.set_pwm_freq(60)

print('Moving servo on channel 0, press Ctrl-C to quit...')

Move servo on channel O between extremes.

pwm.set_pwm(4, 0, servo_min)
sleep(1000)
pwm.set_pwm(4, 0, servo_max)
sleep(1000)

Use servo helper class to move channel 0 by degrees

s0 = servo.Servos(i2c)
s0.position(0, 90)
sleep(1000)
s0.release(0)

micro:bit i2c.write error -1010

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。

An error in PCA9685.py

In the module PCA9685.py, in the duty() definition, there is an attempt to use set_pwm() without on and off arguments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.