Drive a BlinkM with Python via I2C using python-smbus on Raspberry Pi.
$ sudo apt-get install python-smbus
$ sudo pip install pyblinkm
$ python
>>> from pyblinkm import BlinkM, Scripts
>>> blinkm = BlinkM()
>>> blinkm.reset()
>>> blinkm.play_script(Scripts.THUNDERSTORM)
>>> blinkm.reset()
>>> blinkm.fade_to(255, 0, 0)
>>> blinkm.fade_to_hex("ff0000")
>>> blinkm.go_to(0, 255, 0)
Contents:
module(name[, doc])
Create a module object. The name must be a string; the optional doc argument can have any type.
Drop dead simple BlinkM control.
Parameters: |
|
---|
Fade to RGB Color.
Fade to Hexadecimal Color.
Fade to HSB Color.
Parameters: |
|
---|
Fade to color from Blue (Cold) to Red (Hot).
Takes an input from 0-100 and convert it to HSB from 180/100/100 to 0/100/100.
Fade to Random RGB Color.
Get Current RGB Color.
Returns current red, green and blue channels.
Go to RGB Color Now.
Go to Hexadecimal Color Now.
Play Light Script.
Stop script and fade to black.
Set Fade Speed.
Parameters: | fade_speed – fade speed from 1-255. |
---|
Set Time Adjust.
Adjusts the playback speed of a light script.
Parameters: | adjust – Relative adjustement between -128 and 127. |
---|
Stop playing script.
I2C Connection Manager
Parameters: |
|
---|
Default BlinkM Scripts Reference.