Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

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

README.md

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

Packages

No packages published

Languages

You can’t perform that action at this time.