libBlinkStick
A simple blinkstick library
Classes | Typedefs | Functions
libblinkstick.h File Reference

Header for libBlinkStick. More...

#include <hidapi/hidapi.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

Go to the source code of this file.

Classes

struct  blinkstick_device
 

Typedefs

typedef struct blinkstick_device blinkstick_device
 

Functions

blinkstick_device ** blinkstick_find_many (int count)
 
blinkstick_deviceblinkstick_find ()
 
void blinkstick_set_color (blinkstick_device *device, int index, int red, int green, int blue)
 
void blinkstick_off (blinkstick_device *device, int index)
 
void blinkstick_debug ()
 
void blinkstick_destroy (blinkstick_device *device)
 

Detailed Description

Header for libBlinkStick.

libBlinkStick is meant to to be a simple library for talking to a blinkstick Both the blinkstick square and blinkstick v1.1 are officially supported and it's likely that other devices work as well.

libBlinkStick depends on hidapi for interacting with the USB devices, but otherwise has no other dependencies.

Included are functions to turn on and off any of the LEDs and change their color via an rgb color. Multiple devices are supported.

Typedef Documentation

◆ blinkstick_device

A blinkstick_device holds a pointer to the hid device and is used when setting colors, modes, or turning the device off. Construct this device by using blinkstick_find and free it with blinkstick_destroy.

Function Documentation

◆ blinkstick_destroy()

void blinkstick_destroy ( blinkstick_device device)

Frees the given blinkstick device

◆ blinkstick_find()

blinkstick_device* blinkstick_find ( )

Find the first blinkstick device on the bus registered with HID.

◆ blinkstick_find_many()

blinkstick_device** blinkstick_find_many ( int  count)

Given a count will return a pointer array of blinkstick devices. This will abort if the number found is less than the given count.

◆ blinkstick_off()

void blinkstick_off ( blinkstick_device device,
int  index 
)

Turns off the led at the specified index for the provided device.

This is the same as using set_color with the RGB value (0, 0, 0)

◆ blinkstick_set_color()

void blinkstick_set_color ( blinkstick_device device,
int  index,
int  red,
int  green,
int  blue 
)

Sets the LED at the given index to the specified color for the provided device