Giter Site home page Giter Site logo

marcelstoer / nodemcu-max7219 Goto Github PK

View Code? Open in Web Editor NEW
32.0 7.0 9.0 8 KB

A NodeMCU library to write to MAX7219 8x8 matrix and 7-segment displays using SPI

Home Page: https://frightanic.com/iot/max7219-library-nodemcu-making/

License: MIT License

Lua 100.00%
nodemcu led-displays led-matrix-displays

nodemcu-max7219's Introduction

NodeMCU MAX7219

License

A NodeMCU library to write to MAX7219 8x8 matrix displays and 7-Segment modules using SPI

https://frightanic.com/iot/max7219-library-nodemcu-making/

Hint: The module (not the logic) needs to be powered by 5V otherwise it can lead to undefined behavior.

a = { 0x20, 0x74, 0x54, 0x54, 0x3C, 0x78, 0x40, 0x00 }
b = { 0x41, 0x7F, 0x3F, 0x48, 0x48, 0x78, 0x30, 0x00 }
c = { 0x38, 0x7C, 0x44, 0x44, 0x6C, 0x28, 0x00, 0x00 }
d = { 0x30, 0x78, 0x48, 0x49, 0x3F, 0x7F, 0x40, 0x00 }
max7219 = require("max7219")
max7219.setup({ debug = true, numberOfModules = 4, slaveSelectPin = 8, intensity = 6 })
max7219.write({a, b, c, d}, { rotate = "left" })
  
-- Clear the module(s):
max7219.clear()
  
-- Turn the module(s) off without loosing the text:
max7219.shutdown(true)

-- Turn the module(s) on:
max7219.shutdown(false)

-- Set minimum brightness:
max7219.setIntensity(0)

-- Set maximum brightness:
max7219.setIntensity(15)

-- Write to a 7-Segment module (these characters are not supported: kmwxKMWX):
max7219.write7segment("HELLO")

-- The decimal point is supported as well:
max7219.write7segment("32.5°C")

-- Write to a 7-Segment module and right-align the text:
max7219.write7segment("HELLO", true)

All missing features are tracked as issues on GitHub.

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.