Hardware Reference
In-Depth Information
2.
A list of scripts available on the BlinkM is shown in the following screenshot:
Description
Color sequence
white
Id
eeprom script
(can be programmed)
red
red
green
blue
off
0
default startup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
RGB
white
green
blue
white flash
off
red flash
red
green
off
green flash
off
blue flash
blue
cyan
off
cyan flash
magenta
off
magenta flash
off
yellow flash
yellow
off
black
off
red
hue cycle
random hue
yellow
green
cyan
blue
purple
mood light
random yellows
random blues
random orangeish reds
spring colors
random hue
virtual candle
water reflections
old neon
the seasons
random blues & purples
summer
fall
winter
white flashes
thunderstrom
stop light
red
S.O.S in white
green
yellow
morse code
A list of scripts available on the BlinkM
3.
Let's see the code to execute a light script (for example, script number 6) on the
BlinkM using the Adafruit WebIDE interface. In order to execute a script forever, the
datasheet menions that the following characters should be writen at the I2C device
address in the following sequence:
'p',<script no>,0,0
. Let's discuss how to
execute this using a Python script on the Raspberry Pi interfaced with the BlinkM
LED. The Python script of this example is called
Play_blinkm.py
:
The
Play_blinkm.py
file can be executed by creating a new file in the
repository that was created when you signed up for a Bitbucket account.
When the file is saved, the changes are saved to your Bitbucket account.
The code for this is given as follows:
#!/usr/bin/python
#python-smbus
import smbus
#create i2c object