sandyjmacdonald / bearables Goto Github PK
View Code? Open in Web Editor NEWPython library for the Pimoroni Bearables badges
License: MIT License
Python library for the Pimoroni Bearables badges
License: MIT License
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() 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?
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.