Skip to content

Nilhcem/blinkt-androidthings

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Pimoroni Blinkt! driver for Android Things

Tested successfully on the Raspberry Pi 3, and the Pico i.MX7D.

Photo

photo

Download

dependencies {
    implementation 'com.nilhcem.androidthings:driver-blinkt:0.0.3'
}

Usage

Easy (global brightness, sending an array of colors)

Blinkt blinkt = new Blinkt();
blinkt.setBrightness(1);
blinkt.write(new int[]{Color.RED, Color.GREEN, Color.BLUE, Color.DKGRAY, Color.YELLOW, Color.MAGENTA, Color.CYAN, 0xFF9B6E26});
blinkt.close();

Advanced (brightness per LED, sending colors individually, showing in a reversed order)

Blinkt blinkt = new Blinkt(DATA_GPIO, CLOCK_GPIO);
blinkt.setDirection(Blinkt.Direction.REVERSED);

for (int i = 0; i < Blinkt.LEDSTRIP_LENGTH; i++) {
    int color = Color.HSVToColor(255, new float[]{i * 360.f / Blinkt.LEDSTRIP_LENGTH, 1.0f, 1.0f});
    int brightness = (int) ((float) Blinkt.MAX_BRIGHTNESS / Blinkt.LEDSTRIP_LENGTH * (i + 1));
    blinkt.setColor(i, color, brightness);
}
blinkt.show();

blinkt.close();

Kudos

This project was inspired by code from:

About

Android Things driver for Pimoroni's Blinkt! hat

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages