It's apache v2 licensed (can be used in closed, commercial and open environments).
Code sample:
Code: Select all
/* prepare the backpack driver
(the first parameter is the raspberry pi i2c master controller attached to the HT16K33, the second is the i2c selection jumper)
The i2c selection address can be one of HT16K33_ADDR_01 to HT16K33_ADDR_08
*/
HT16K33 led_backpack1 = HT16K33_INIT(1, HT16K33_ADDR_01);
/* initialize the backpack */
rc = HT16K33_OPEN(&led_backpack1);
/* power on the ht16k33 */
HT16K33_ON(&led_backpack1);
/* make it shining bright */
HT16K33_BRIGHTNESS(&led_backpack1, 0x0F);
/* make it not blinking */
HT16K33_BLINK(&led_backpack1, HT16K33_BLINK_OFF);
/* power on the display */
HT16K33_DISPLAY(&led_backpack1, HT16K33_DISPLAY_ON);
/* Say hello */
HT16K33_UPDATE_DIGIT(&led_backpack1, 0, ‘H’, 0); // first digit
HT16K33_UPDATE_DIGIT(&led_backpack1, 1, ‘E’, 0); // second digit
// turn off the colon sign in the middle of the 4 digits
HT16K33_UPDATE_DIGIT(&led_backpack1, 2, HT16K33_COLON_OFF, 0);
HT16K33_UPDATE_DIGIT(&led_backpack1, 3, ‘#’, 0); // third digit
HT16K33_UPDATE_DIGIT(&led_backpack1, 4, ‘o’, 0); // fourth digit
HT16K33_COMMIT(&led_backpack1); // commit to the display memory
// call this if you want to shut down the device (power saving mode)
// HT16K33_OFF(&led_backpack1);
/* close things (the display remains in the conditions left) */
HT16K33_CLOSE(&led_backpack1);
Ciao, Dino Ciuffetti.