Go/TinyGo driver for Lumissil IS31FL3731 matrix LED driver

IS31FL3731

GoDoc Go Report Card Conventional Commits

Go/TinyGo driver for Lumissil IS31FL3731 matrix LED driver.

PR to include this driver to the official TinyGo driver list

What's implemented

  • picture mode ("auto frame play mode" and "audio frame play mode" are not supported in this version of the driver)
  • drawing by XY coordinates or raw pixel's index on LED layout
  • frames (0-7) and switching between them

Supported boards

Chip details

Example

Driver can work with any Go program that provides I2C interface like this:

type I2C interface {
  WriteRegister(addr uint8, r uint8, buf []byte) error
}

This is TinyGo example that uses machine package's I2C to control Adafruit 15x7 CharlieWing:

package main

import (
  "time"
  "machine"

  "github.com/antonfisher/is31fl3731"
)

// I2CAddress -- address of led matrix
var I2CAddress uint8 = 0x74

func main() {
  bus := machine.I2C0
  err := bus.Configure(machine.I2CConfig{})
  if err != nil {
    println("could not configure I2C:", err)
    return
  }

  // Create driver for Adafruit 15x7 CharliePlex LED Matrix FeatherWing
  // (CharlieWing): https://www.adafruit.com/product/3163
  ledMatrix, err := is31fl3731.NewAdafruitCharlieWing15x7(bus, I2CAddress)
  if err != nil {
    println("could not create driver:", err)
    return
  }

  // Fill the whole matrix on the frame #0 (visible by default)
  ledMatrix.Fill(is31fl3731.FRAME_0, uint8(3))

  // Draw couple pixels on the frame #1 (not visible yet)
  ledMatrix.DrawPixelXY(is31fl3731.FRAME_1, uint8(0), uint8(0), uint8(10))
  ledMatrix.DrawPixelXY(is31fl3731.FRAME_1, uint8(14), uint8(6), uint8(10))

  // There are 8 frames available, it's a good idea to draw on an invisible
  // frame and then switch to that frame to reduce flickering. Switch between
  // frame #0 and #1 in a loop to show animation:
  for {
    println("show frame #0...")
    ledMatrix.SetActiveFrame(is31fl3731.FRAME_0)
    time.Sleep(time.Second * 3)

    println("show frame #1...")
    ledMatrix.SetActiveFrame(is31fl3731.FRAME_1)
    time.Sleep(time.Second * 3)
  }
}

This example code switches display between these two states:

picture of the display with all LEDs enabled picture of the display with only two LEDs enabled

Note: tested on nRF52840 controller.

Inspired by

This driver inspired by Adafruit Python driver: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731

License

MIT License

Owner
Similar Resources

Cross-platform Bluetooth API for Go and TinyGo.

Cross-platform Bluetooth API for Go and TinyGo.

Go Bluetooth is a cross-platform package for using Bluetooth Low Energy hardware from the Go programming language.

Jan 6, 2023

Toy Shader in TinyGo for Game Boy Advance.

Toy Shader in TinyGo for Game Boy Advance.

toyshader.gba Toy Shader in TinyGo for Game Boy Advance. Releases v0.2: 80x80 screen with 3x2 pixel block version for drawing speed. v0.1: 240x160 pix

Oct 29, 2022

`tinydisplay` is a tiny display for TinyGo development.

`tinydisplay` is a tiny display for TinyGo development.

tinydisplay tinydisplay is a tiny display for TinyGo development. tinydisplay works on windows, macOS and linux. Usage First, run ./cmd/tinydisplay. N

Oct 9, 2022

2048 using the fantasy console WASM-4 and TinyGo

2048 using the fantasy console WASM-4 and TinyGo

w4-2048 🎮 Play 🎵 With music 🔉 🎵 With sound and music Game logic initially based on https://github.com/chhabraamit/2048 Controls Arrow keys X Z Res

Jul 9, 2022

TinyGo attitude estimation simulation applet.

tiny-ahrsim TinyGo attitude estimation simulation applet. Instructions Requirements Go installed (golang.org) git installed (git-scm.com) TinyGo insta

Oct 26, 2022

software keyboard for TinyGo

software keyboard for TinyGo

tinykb tinykb is a software keyboard for TinyGo. To use tinykb, it is necessary to implement the driver.Displayer interface. It is still an alpha vers

Jan 14, 2022

TinyGo Hands-on-From L Chika to Application with Go

TinyGo Hands-on-From L Chika to Application with Go

TinyGo Hands-on-From L Chika to Application with Go

Nov 10, 2022

The note-tinygo Go library for communicating with Blues Wireless Notecard via serial or I²C

Blues Wireless The note-tinygo Go library for communicating with Blues Wireless Notecard via serial or I²C. This library allows you to control a Notec

Nov 29, 2021

tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

tinygo-used-files is a CLI tool that lists only the files to be built as specified by buildtag.

Feb 6, 2022

A reimplementation of the TinyGo drivers package for communicating with multiples of the same (supported) devices on one individual I2C bus.

tinygo-multi-i2c A reimplementation of the TinyGo drivers package for communicating with multiples of the same (supported) devices on one individual I

Mar 10, 2022

Sparse matrix formats for linear algebra supporting scientific and machine learning applications

Sparse matrix formats Implementations of selected sparse matrix formats for linear algebra supporting scientific and machine learning applications. Co

Dec 12, 2022

Sparse matrix formats for linear algebra supporting scientific and machine learning applications

Sparse matrix formats Implementations of selected sparse matrix formats for linear algebra supporting scientific and machine learning applications. Co

Jan 8, 2023

A Matrix-iMessage puppeting bridge

A Matrix-iMessage puppeting bridge. The bridge runs on a Mac or jailbroken iPhone (soonâ„¢). A websocket proxy is required to receive appservice events from the homeserver.

Jan 2, 2023

Hummingbard is an experimental client for building decentralized communities on top of Matrix.

Hummingbard is an experimental client for building decentralized communities on top of Matrix.

Oct 11, 2022

Dendrite is a second-generation Matrix homeserver written in Go!

Dendrite Dendrite is a second-generation Matrix homeserver written in Go. It intends to provide an efficient, reliable and scalable alternative to Syn

Jan 8, 2023

Simple Command line for matrix in Go

Is a simple and not finished project for the Matrix protocol to interact.

Dec 19, 2021

Minimalistic library for basic matrix operations.

MATRIX Maybe a bit slow, but minimalistic library for basic matrix operations. Available functions Function signature Description Equal(a, b [][]float

Nov 4, 2021

Bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API

Bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)

Jan 4, 2023

A Golang Matrix client

A Golang Matrix client

Dec 24, 2022
software keyboard for TinyGo
software keyboard for TinyGo

tinykb tinykb is a software keyboard for TinyGo. To use tinykb, it is necessary to implement the driver.Displayer interface. It is still an alpha vers

Jan 14, 2022
A reimplementation of the TinyGo drivers package for communicating with multiples of the same (supported) devices on one individual I2C bus.

tinygo-multi-i2c A reimplementation of the TinyGo drivers package for communicating with multiples of the same (supported) devices on one individual I

Mar 10, 2022
Sensirion SCD30 CO2 sensor i2c driver module for Golang

Sensirion SCD30 CO2 sensor i2c driver module for Golang Overview With this module Sensirion SCD30 CO2 sensor can be accessed throug i2c bus. Implement

Oct 9, 2022
A go driver for the adafruit I2C 7 Segment display

A go driver for the adafruit I2C 7 Segment display

Nov 21, 2021
Watchdog for the unreliable nut-driver on the Raspberry Pi

nut-watcher For some reason, nut-driver on the Raspberry Pi likes to break. Every few days it stalls out trying to talk to my UPS. nut-watcher is a si

Dec 6, 2021
Go binding for rpi-rgb-led-matrix an excellent C++ library to control RGB LED displays with Raspberry Pi GPIO.
Go binding for rpi-rgb-led-matrix an excellent C++ library to control RGB LED displays with Raspberry Pi GPIO.

go-rpi-rgb-led-matrix Go binding for rpi-rgb-led-matrix an excellent C++ library to control RGB LED displays with Raspberry Pi GPIO. This library incl

Dec 30, 2022
The Official Twilio SendGrid Led, Community Driven Golang API Library
The Official Twilio SendGrid Led, Community Driven Golang API Library

NEW: Subscribe to email notifications for releases and breaking changes. The default branch name for this repository has been changed to main as of 07

Dec 15, 2022
Display a message in morse code on your capslock LED, keyboard backlight or using your screen brightness!
Display a message in morse code on your capslock LED, keyboard backlight or using your screen brightness!

halp halp is a command line utility that lets you display messages in morse code on your capslock LED, keyboard backlight (if you have it) or using yo

Jan 26, 2022
Go package for interacting with the "ELK" Bluetooth Low Energy RGB LED Controller
Go package for interacting with the

Go interactions for the ELK-BLEDOM RGB LED Controller This repository contains information on the common (and cheap) ELK-BLEDOM Bluetooth Low Energy R

Jan 2, 2023
TinyGo drivers for sensors and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.

TinyGo Drivers This package provides a collection of hardware drivers for devices such as sensors and displays that can be used together with TinyGo.

Jan 8, 2023