Package blinkstick :: Module blinkstick :: Class BlinkStickPro
[frames] | no frames]

Class BlinkStickPro

source code

object --+
         |
        BlinkStickPro
Known Subclasses:

BlinkStickPro class is specifically designed to control the individually addressable LEDs connected to the device. The tutorials section contains all the details on how to connect them to BlinkStick Pro.

http://www.blinkstick.com/help/tutorials

Code example on how you can use this class are available here:

https://github.com/arvydas/blinkstick-python/wiki#code-examples-for-blinkstick-pro

Instance Methods
 
__init__(self, r_led_count=0, g_led_count=0, b_led_count=0, delay=0.002, max_rgb_value=255)
Initialize BlinkStickPro class.
source code
 
set_color(self, channel, index, r, g, b, remap_values=True)
Set the color of a single pixel
source code
(int, int, int)
get_color(self, channel, index)
Get the current color of a single pixel.
source code
 
clear(self)
Set all pixels to black in the frame buffer.
source code
 
off(self)
Set all pixels to black in on the device.
source code
 
connect(self, serial=None)
Connect to the first BlinkStick found
source code
 
send_data(self, channel)
Send data stored in the internal buffer to the channel.
source code
 
send_data_all(self)
Send data to all channels
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, r_led_count=0, g_led_count=0, b_led_count=0, delay=0.002, max_rgb_value=255)
(Constructor)

source code 

Initialize BlinkStickPro class.

Parameters:
  • r_led_count (int) - number of LEDs on R channel
  • g_led_count (int) - number of LEDs on G channel
  • b_led_count (int) - number of LEDs on B channel
  • delay (int) - default transmission delay between frames
  • max_rgb_value (int) - maximum color value for RGB channels
Overrides: object.__init__

set_color(self, channel, index, r, g, b, remap_values=True)

source code 

Set the color of a single pixel

Parameters:
  • channel (int) - R, G or B channel
  • index (int) - the index of LED on the channel
  • r (int) - red color byte
  • g (int) - green color byte
  • b (int) - blue color byte

get_color(self, channel, index)

source code 

Get the current color of a single pixel.

Parameters:
  • channel (int) - the channel of the LED
  • index (int) - the index of the LED
Returns: (int, int, int)
3-tuple for R, G and B values

connect(self, serial=None)

source code 

Connect to the first BlinkStick found

Parameters:
  • serial (str) - Select the serial number of BlinkStick

send_data(self, channel)

source code 

Send data stored in the internal buffer to the channel.

Parameters:
  • channel -
    • 0 - R pin on BlinkStick Pro board
    • 1 - G pin on BlinkStick Pro board
    • 2 - B pin on BlinkStick Pro board