Android Things driver for the MAX7219 and MAX7221 Led drivers (includes demo app)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
gradle/wrapper
max72xx-driver
.gitignore
LICENSE
README.md
build.gradle
circle.yml
gradlew
gradlew.bat
settings.gradle

README.md

CircleCI

androidthings-MAX72XX-driver

Android Things driver for the MAX7219 and MAX7221 Led drivers

This is a Kotlin port of the LedControlAndroid Things library which is also a port of the original Arduino version.

Download

dependencies {
    compile 'rocks.androidthings:max72xx-driver:0.2'
}

Usage

Initialising

try {
    ledControl = MAX72XX("SPI0.0", NB_DEVICES)
    for (i in 0..ledControl.getDeviceCount() - 1) {
        ledControl.setIntensity(i, 15)
        ledControl.shutdown(i, false)
        ledControl.clearDisplay(i)
    }

} catch (e: IOException) {
    Log.e(TAG, "Error initializing LED matrix", e)
}

Turn on one pixel

// set row 0, column 1
ledControl.setLed(0, 0, 1, true)
// set row 0, column 2
ledControl.setLed(0, 0, 2, true)

Sample Schematics (with dot matrix)

max72xx