Giter Club home page Giter Club logo

micropython-max7219-1's Introduction

micropython-max7219

MicroPython driver for MAX7219 8x8 LED matrix

CI status

What is it?

This library provides support for the MAX7219 8x8 LED matrix on ESP8266 with MicroPython. It uses framebuf internally to provide drawing primitives and text support. You can chain several matrices the way you like: if you use two 4x 8x8 matrices, you can have one of the left, and the other on the right giving you a 64x8 area, or have one on top of the other to have a 32x16 display!

The library has only been tested on an ESP8266 (yet!) but may work on other systems.

Connecting on ESP8266

ESP8266 MAX7219
5V VCC
GND GND
D7 (GPIO13) DIN
D8 (GPIO15) CS
D5 (GPIO14) CLK

Examples

Using 10000000 as baudrate is recommended as greater values don't seem to work well...

Single 8x8 matrix

from machine import Pin, SPI
import max7219

spi = SPI(1, baudrate=10000000)
screen = Max7219(8, 8, spi, Pin(15))
screen.text('A', 0, 0, 1)
screen.show()

Single 4x 8x8 matrix

from machine import Pin, SPI
import max7219

spi = SPI(1, baudrate=10000000)
screen = Max7219(32, 8, spi, Pin(15))
screen.text('ABCD', 0, 0, 1)
screen.show()

Two 4x 8x8 matrices (left/right)

from machine import Pin, SPI
import max7219

spi = SPI(1, baudrate=10000000)
screen = Max7219(64, 8, spi, Pin(15))
screen.text('ABCDEFGH', 0, 0, 1)
screen.show()

Two 4x 8x8 matrices (top/bottom)

from machine import Pin, SPI
import max7219

spi = SPI(1, baudrate=10000000)
screen = Max7219(32, 16, spi, Pin(15))
screen.text('ABCD', 0, 0, 1)
screen.text('EFGH', 0, 8, 1)
screen.show()

Credits

This library is based on:

Thank you for the inspiration!

micropython-max7219-1's People

Contributors

vrialland avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.