C# 클래스 BlinkStickDotNet.BlinkStick

A model of the BlinkStick device itself
상속: IDisposable
파일 보기 프로젝트 열기: arvydas/BlinkStickDotNet 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
connectedToDriver bool

공개 메소드들

메소드 설명
Blink ( RgbColor color, int repeats = 1, int delay = 500 ) : void

Blink the LED.

Blink ( byte channel, byte index, RgbColor color, int repeats = 1, int delay = 500 ) : void

Blink the LED on BlinkStick Pro.

Blink ( byte channel, byte index, byte r, byte g, byte b, int repeats = 1, int delay = 500 ) : void

Blink the LED on BlinkStick Pro.

Blink ( byte r, byte g, byte b, int repeats = 1, int delay = 500 ) : void

Blink the LED.

Blink ( byte channel, byte index, string color, int repeats = 1, int delay = 500 ) : void

Blink the LED on BlinkStick Pro.

Blink ( string color, int repeats = 1, int delay = 500 ) : void

Blink the LED.

BlinkStick ( ) : System

Initializes a new instance of the BlinkStick class.

BlinkStickDeviceFromSerial ( string serial ) : BlinkStickDeviceEnum
CloseDevice ( ) : void

Closes the connection to the device.

Dispose ( ) : void

Disposes of the device and closes the connection.

Enable ( ) : void
FindAll ( ) : BlinkStickDotNet.BlinkStick[]

Find all BlinkStick devices.

FindBySerial ( String serial ) : BlinkStick

Finds BlinkStick by serial number.

FindFirst ( ) : BlinkStick

Find first BlinkStick.

GetColor ( byte &r, byte &g, byte &b ) : System.Boolean

Gets the color of the led.

GetColor ( byte index, byte &r, byte &g, byte &b ) : System.Boolean

Gets the color of the led.

GetColors ( byte &colorData ) : System.Boolean

Gets led data.

GetInfoBlock ( byte id, byte &data ) : System.Boolean

Gets the info block.

GetLedCount ( ) : int
GetMode ( ) : int

Gets the mode on BlinkStick Pro.

Morph ( RgbColor color, int duration = 1000, int steps = 50 ) : void

Morph from current color to new color.

Morph ( byte channel, byte index, RgbColor color, int duration = 1000, int steps = 50 ) : void

Morph from current color to new color on BlinkStick Pro.

Morph ( byte channel, byte index, byte r, byte g, byte b, int duration = 1000, int steps = 50 ) : void

Morph from current color to new color on BlinkStick Pro.

Morph ( byte r, byte g, byte b, int duration = 1000, int steps = 50 ) : void

Morph from current color to new color.

Morph ( byte channel, byte index, string color, int duration = 1000, int steps = 50 ) : void

Morph from current color to new color on BlinkStick Pro.

Morph ( string color, int duration = 1000, int steps = 50 ) : void

Morph from current color to new color.

OnReceiveColor ( byte index, byte &r, byte &g, byte &b ) : System.Boolean
OnSendColor ( byte channel, byte index, byte r, byte g, byte b ) : System.Boolean
OpenDevice ( ) : bool

Attempts to connect to a BlinkStick device. After a successful connection, a DeviceAttached event will normally be sent.

OpenDevice ( HidDevice adevice ) : bool

Opens the device.

Pulse ( RgbColor color, int repeats = 1, int duration = 1000, int steps = 50 ) : void

Pulse specified color.

Pulse ( byte channel, byte index, RgbColor color, int repeats = 1, int duration = 1000, int steps = 50 ) : void

Pulse specified color on BlinkStick Pro.

Pulse ( byte channel, byte index, byte r, byte g, byte b, int repeats = 1, int duration = 1000, int steps = 50 ) : void

Pulse specified color on BlinkStick Pro.

Pulse ( byte r, byte g, byte b, int repeats = 1, int duration = 1000, int steps = 50 ) : void

Pulse specified color.

Pulse ( byte channel, byte index, string color, int repeats = 1, int duration = 1000, int steps = 50 ) : void

Pulse specified color on BlinkStick Pro.

Pulse ( string color, int repeats = 1, int duration = 1000, int steps = 50 ) : void

Pulse specified color.

SetColor ( RgbColor color ) : void

Sets the color of the led.

SetColor ( String color ) : void

Sets the color of the led.

SetColor ( byte channel, byte index, RgbColor color ) : void

Sets the color of the led.

SetColor ( byte r, byte g, byte b ) : void

Sets the color of the led.

SetColor ( byte channel, byte index, byte r, byte g, byte b ) : void

Sets the color of the led.

SetColor ( byte channel, byte index, string color ) : void

Sets the color of the led.

SetColors ( byte channel, byte colorData ) : void

Send a packet of data to LEDs

SetLedCount ( byte count ) : void
SetMode ( byte mode ) : void

Sets the mode for BlinkStick Pro.

Stop ( ) : void
TurnOff ( ) : void

Turn BlinkStick off.

WaitThread ( long milliseconds ) : System.Boolean

보호된 메소드들

메소드 설명
SetInfoBlock ( byte id, byte data ) : void

비공개 메소드들

메소드 설명
CheckRequiresSoftwareColorPatch ( ) : void

Checks if BlinkStick requires software color patch due to hardware bug.

Dispose ( bool disposing ) : void

Closes any connected devices.

GetFeature ( byte buffer ) : void
GetInfoBlock ( byte id, string &data ) : System.Boolean
InternalSetColor ( byte channel, byte index, byte r, byte g, byte b ) : void

Automatically sets the color of the device using either BlinkStick or BlinkStick Pro API

OpenCurrentDevice ( ) : bool

Opens the current device.

SetFeature ( byte buffer ) : void
SetInfoBlock ( byte id, string data ) : void

Sets the info block.

메소드 상세

Blink() 공개 메소드

Blink the LED.
public Blink ( RgbColor color, int repeats = 1, int delay = 500 ) : void
color RgbColor Must be in #rrggbb format or named color ("red", "green", "blue")
repeats int How many times to repeat (default 1)
delay int Delay delay between on/off sequences (default 500)
리턴 void

Blink() 공개 메소드

Blink the LED on BlinkStick Pro.
public Blink ( byte channel, byte index, RgbColor color, int repeats = 1, int delay = 500 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color RgbColor Color parameter as RgbColor class instance
repeats int How many times to repeat (default 1)
delay int Delay delay between on/off sequences (default 500)
리턴 void

Blink() 공개 메소드

Blink the LED on BlinkStick Pro.
public Blink ( byte channel, byte index, byte r, byte g, byte b, int repeats = 1, int delay = 500 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
r byte The red component.
g byte The green component.
b byte The blue component.
repeats int How many times to repeat (default 1)
delay int Delay delay between on/off sequences (default 500)
리턴 void

Blink() 공개 메소드

Blink the LED.
public Blink ( byte r, byte g, byte b, int repeats = 1, int delay = 500 ) : void
r byte The red component.
g byte The green component.
b byte The blue component.
repeats int How many times to repeat (default 1)
delay int Delay delay between on/off sequences (default 500)
리턴 void

Blink() 공개 메소드

Blink the LED on BlinkStick Pro.
public Blink ( byte channel, byte index, string color, int repeats = 1, int delay = 500 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color string Must be in #rrggbb format or named color ("red", "green", "blue")
repeats int How many times to repeat (default 1)
delay int Delay delay between on/off sequences (default 500)
리턴 void

Blink() 공개 메소드

Blink the LED.
public Blink ( string color, int repeats = 1, int delay = 500 ) : void
color string Must be in #rrggbb format or named color ("red", "green", "blue")
repeats int How many times to repeat (default 1)
delay int Delay delay between on/off sequences (default 500)
리턴 void

BlinkStick() 공개 메소드

Initializes a new instance of the BlinkStick class.
public BlinkStick ( ) : System
리턴 System

BlinkStickDeviceFromSerial() 공개 정적인 메소드

public static BlinkStickDeviceFromSerial ( string serial ) : BlinkStickDeviceEnum
serial string
리턴 BlinkStickDeviceEnum

CloseDevice() 공개 메소드

Closes the connection to the device.
public CloseDevice ( ) : void
리턴 void

Dispose() 공개 메소드

Disposes of the device and closes the connection.
public Dispose ( ) : void
리턴 void

Enable() 공개 메소드

public Enable ( ) : void
리턴 void

FindAll() 공개 정적인 메소드

Find all BlinkStick devices.
public static FindAll ( ) : BlinkStickDotNet.BlinkStick[]
리턴 BlinkStickDotNet.BlinkStick[]

FindBySerial() 공개 정적인 메소드

Finds BlinkStick by serial number.
public static FindBySerial ( String serial ) : BlinkStick
serial String Serial number to search for
리턴 BlinkStick

FindFirst() 공개 정적인 메소드

Find first BlinkStick.
public static FindFirst ( ) : BlinkStick
리턴 BlinkStick

GetColor() 공개 메소드

Gets the color of the led.
public GetColor ( byte &r, byte &g, byte &b ) : System.Boolean
r byte The red component.
g byte The green component.
b byte The blue component.
리턴 System.Boolean

GetColor() 공개 메소드

Gets the color of the led.
public GetColor ( byte index, byte &r, byte &g, byte &b ) : System.Boolean
index byte
r byte The red component.
g byte The green component.
b byte The blue component.
리턴 System.Boolean

GetColors() 공개 메소드

Gets led data.
public GetColors ( byte &colorData ) : System.Boolean
colorData byte
리턴 System.Boolean

GetInfoBlock() 공개 메소드

Gets the info block.
public GetInfoBlock ( byte id, byte &data ) : System.Boolean
id byte Identifier.
data byte Data.
리턴 System.Boolean

GetLedCount() 공개 메소드

public GetLedCount ( ) : int
리턴 int

GetMode() 공개 메소드

Gets the mode on BlinkStick Pro.
public GetMode ( ) : int
리턴 int

Morph() 공개 메소드

Morph from current color to new color.
public Morph ( RgbColor color, int duration = 1000, int steps = 50 ) : void
color RgbColor Must be in #rrggbb format or named color ("red", "green", "blue")
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Morph() 공개 메소드

Morph from current color to new color on BlinkStick Pro.
public Morph ( byte channel, byte index, RgbColor color, int duration = 1000, int steps = 50 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color RgbColor Color parameter as RgbColor class instance
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Morph() 공개 메소드

Morph from current color to new color on BlinkStick Pro.
public Morph ( byte channel, byte index, byte r, byte g, byte b, int duration = 1000, int steps = 50 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
r byte The red component.
g byte The green component.
b byte The blue component.
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Morph() 공개 메소드

Morph from current color to new color.
public Morph ( byte r, byte g, byte b, int duration = 1000, int steps = 50 ) : void
r byte The red component.
g byte The green component.
b byte The blue component.
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Morph() 공개 메소드

Morph from current color to new color on BlinkStick Pro.
public Morph ( byte channel, byte index, string color, int duration = 1000, int steps = 50 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color string Must be in #rrggbb format or named color ("red", "green", "blue")
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Morph() 공개 메소드

Morph from current color to new color.
public Morph ( string color, int duration = 1000, int steps = 50 ) : void
color string Must be in #rrggbb format or named color ("red", "green", "blue")
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

OnReceiveColor() 공개 메소드

public OnReceiveColor ( byte index, byte &r, byte &g, byte &b ) : System.Boolean
index byte
r byte
g byte
b byte
리턴 System.Boolean

OnSendColor() 공개 메소드

public OnSendColor ( byte channel, byte index, byte r, byte g, byte b ) : System.Boolean
channel byte
index byte
r byte
g byte
b byte
리턴 System.Boolean

OpenDevice() 공개 메소드

Attempts to connect to a BlinkStick device. After a successful connection, a DeviceAttached event will normally be sent.
public OpenDevice ( ) : bool
리턴 bool

OpenDevice() 공개 메소드

Opens the device.
public OpenDevice ( HidDevice adevice ) : bool
adevice HidLibrary.HidDevice Pass the parameter of HidDevice to open it directly
리턴 bool

Pulse() 공개 메소드

Pulse specified color.
public Pulse ( RgbColor color, int repeats = 1, int duration = 1000, int steps = 50 ) : void
color RgbColor Must be in #rrggbb format or named color ("red", "green", "blue")
repeats int
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Pulse() 공개 메소드

Pulse specified color on BlinkStick Pro.
public Pulse ( byte channel, byte index, RgbColor color, int repeats = 1, int duration = 1000, int steps = 50 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color RgbColor Color parameter as RgbColor class instance
repeats int
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Pulse() 공개 메소드

Pulse specified color on BlinkStick Pro.
public Pulse ( byte channel, byte index, byte r, byte g, byte b, int repeats = 1, int duration = 1000, int steps = 50 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
r byte The red component.
g byte The green component.
b byte The blue component.
repeats int
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Pulse() 공개 메소드

Pulse specified color.
public Pulse ( byte r, byte g, byte b, int repeats = 1, int duration = 1000, int steps = 50 ) : void
r byte The red component.
g byte The green component.
b byte The blue component.
repeats int
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Pulse() 공개 메소드

Pulse specified color on BlinkStick Pro.
public Pulse ( byte channel, byte index, string color, int repeats = 1, int duration = 1000, int steps = 50 ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color string Must be in #rrggbb format or named color ("red", "green", "blue")
repeats int
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

Pulse() 공개 메소드

Pulse specified color.
public Pulse ( string color, int repeats = 1, int duration = 1000, int steps = 50 ) : void
color string Must be in #rrggbb format or named color ("red", "green", "blue")
repeats int
duration int How long should the morph last
steps int How many steps for color changes
리턴 void

SetColor() 공개 메소드

Sets the color of the led.
public SetColor ( RgbColor color ) : void
color RgbColor Color as RgbColor class.
리턴 void

SetColor() 공개 메소드

Sets the color of the led.
public SetColor ( String color ) : void
color String Must be in #rrggbb format
리턴 void

SetColor() 공개 메소드

Sets the color of the led.
public SetColor ( byte channel, byte index, RgbColor color ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color RgbColor Color parameter as RgbColor class instance
리턴 void

SetColor() 공개 메소드

Sets the color of the led.
public SetColor ( byte r, byte g, byte b ) : void
r byte The red component.
g byte The green component.
b byte The blue component.
리턴 void

SetColor() 공개 메소드

Sets the color of the led.
public SetColor ( byte channel, byte index, byte r, byte g, byte b ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
r byte The red component.
g byte The green component.
b byte The blue component.
리턴 void

SetColor() 공개 메소드

Sets the color of the led.
public SetColor ( byte channel, byte index, string color ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
index byte Index of the LED
color string Must be in #rrggbb format or named color ("red", "green", "blue")
리턴 void

SetColors() 공개 메소드

Send a packet of data to LEDs
public SetColors ( byte channel, byte colorData ) : void
channel byte Channel (0 - R, 1 - G, 2 - B)
colorData byte
리턴 void

SetInfoBlock() 보호된 메소드

protected SetInfoBlock ( byte id, byte data ) : void
id byte
data byte
리턴 void

SetLedCount() 공개 메소드

public SetLedCount ( byte count ) : void
count byte
리턴 void

SetMode() 공개 메소드

Sets the mode for BlinkStick Pro.
public SetMode ( byte mode ) : void
mode byte 0 - Normal, 1 - Inverse, 2 - WS2812
리턴 void

Stop() 공개 메소드

public Stop ( ) : void
리턴 void

TurnOff() 공개 메소드

Turn BlinkStick off.
public TurnOff ( ) : void
리턴 void

WaitThread() 공개 메소드

public WaitThread ( long milliseconds ) : System.Boolean
milliseconds long
리턴 System.Boolean

프로퍼티 상세

connectedToDriver 보호되어 있는 프로퍼티

protected bool connectedToDriver
리턴 bool