blink(1) mk2 library
Posted: Fri Oct 09, 2015 3:59 pm
Hello,
I have a blink(1) mk2 (https://blink1.thingm.com/) and I'm using the pypi library (https://github.com/todbot/blink1/tree/m ... ython/pypi).
I don't know if anyone has a blink(1) mk2 but anyway. Also I'm pretty new to python, but not new to programming languages.
In the documentation there is an example:
This one works fine.
This one works just for the "green" part.
Here is the error message:
I think that I found the error but I'm not allowed to modify the files through WinSCP.
Is there any way to modify the webcolors.py?
Another "problem" is that the blink(1) mk2 (second version) has two LEDs. Also there is a way to change the color on both LEDs seperetly, but it's not working.
Has anyone a blink(1) mk2 too and can help me?
Sincerely
Mr.Tr33
I have a blink(1) mk2 (https://blink1.thingm.com/) and I'm using the pypi library (https://github.com/todbot/blink1/tree/m ... ython/pypi).
I don't know if anyone has a blink(1) mk2 but anyway. Also I'm pretty new to python, but not new to programming languages.
In the documentation there is an example:
Code: Select all
from blink1.blink1 import Blink1
import time
b1 = Blink1()
b1.fade_to_rgb(1000, 64, 64, 64)
time.sleep(3)
b1.fade_to_rgb(1000, 255, 255, 255)Code: Select all
from blink1.blink1 import Blink1
import time
b1 = Blink1()
b1.fade_to_color(1000, '#ffffff') # Hexdecimal RGB as a string
b1.fade_to_color(1000, 'green') # Named color - any color name understood by css3
b1.fade_to_color(1000, (22,33,44)) # RGB as a tuple. Luminance values are 0 <= lum <= 255Here is the error message:
Code: Select all
pi@raspberrypi ~/projects $ sudo python3 test.py
Traceback (most recent call last):
File "test.py", line 5, in <module>
b1.fade_to_color(1000, '#ffffff') # Hexdecimal RGB as a string
File "/usr/local/lib/python3.4/dist-packages/blink1/blink1.py", line 161, in fade_to_color
red, green, blue = webcolors.name_to_rgb(color)
File "/usr/local/lib/python3.4/dist-packages/webcolors.py", line 384, in name_to_rgb
return hex_to_rgb(name_to_hex(name, spec=spec))
File "/usr/local/lib/python3.4/dist-packages/webcolors.py", line 373, in name_to_hex
u"'%s' is not defined as a named color in %s." % (name, spec)
ValueError: '#ffffff' is not defined as a named color in css3.Is there any way to modify the webcolors.py?
Another "problem" is that the blink(1) mk2 (second version) has two LEDs. Also there is a way to change the color on both LEDs seperetly, but it's not working.
Has anyone a blink(1) mk2 too and can help me?
Sincerely
Mr.Tr33