GithubHelp home page GithubHelp logo

sandyjmacdonald / bearables Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 0.0 12 KB

Python library for the Pimoroni Bearables badges

License: MIT License

Python 100.00%
leds python python-library raspberry-pi

bearables's People

Contributors

sandyjmacdonald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bearables's Issues

Maximum brightness of bear badge led appears to be 8

I was just testing some simpler i2c code and looking at your module for the commands and noticed that visually I cannot see the difference between brightness values of 8 (0b1000) and 15 (0b1111) on a recently purchased bear badge. library/bearables/init.py converts the passed brightness of 0.0 to 1.0 into values to send to the badge with:

brightness = int(brightness * 15.0)

Should that really be 8.0? Note: this code also maps only 1.0 to maximum value due to the int().

https://lorrainbow.wordpress.com/2017/11/18/guest-blogger-phil-underwood-hacking-the-bareables-badge/ states (empirically) that maximum value is 7 so this supports my belief the upper limit is not as large as 15. I can see the difference between 7 and 8 from my testing therefore I think max is actually 8.

(I haven't put a 'scope on the leds to see if there's some pwm going on that's invisible to my eye at 9-15.)

set_pattern and other commands do not look like they can be mixed due to _init()

set_pattern() calls _init(0) whereas the other commands call _init(1). I've only inspected this (haven't run the code) but the initialisation check on _bus variable in _init() looks like it prevents the i2c "led mode change command" being executed more than once? That would prevent mixing of set_pattern with other commands.

If this is a bug it can be fixed with some rejigging of activity inside _init(). If it was intentional then the behaviour/restriction could be documented perhaps?

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.