Documentation ¶
Overview ¶
Package blinkm implements a driver for the BlinkM I2C RGB LED.
Datasheet: http://thingm.com/fileadmin/thingm/downloads/BlinkM_datasheet.pdf
Index ¶
Constants ¶
const ( TO_RGB = 0x6e FADE_TO_RGB = 0x63 FADE_TO_HSB = 0x68 FADE_TO_RND_RGB = 0x43 FADE_TO_RND_HSB = 0x48 PLAY_LIGHT_SCRIPT = 0x70 STOP_SCRIPT = 0x6f SET_FADE = 0x66 SET_TIME = 0x74 GET_RGB = 0x67 GET_ADDRESS = 0x61 SET_ADDRESS = 0x41 GET_FIRMWARE = 0x5a )
Registers, which in the case of the BlinkM are actually commands.
const Address = 0x09
The I2C address which this device listens to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Address uint16 // contains filtered or unexported fields }
Device wraps an I2C connection to a BlinkM device.
func New ¶
New creates a new BlinkM connection. The I2C bus must already be configured.
This function only creates the Device object, it does not touch the device.
func (*Device) Configure ¶
func (d *Device) Configure()
Configure sets up the device for communication
func (Device) FadeToRGB ¶
FadeToRGB sets the RGB color on the BlinkM by fading from the current color to the new color.
func (Device) StopScript ¶
StopScript stops whatever script is currently running on the BlinkM.