Coder Social home page Coder Social logo

mitkz / pxt-smartmatrix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shorts1999/pxt-smartmatrix

0.0 0.0 0.0 108 KB

Makecode extension for ws2812b matrices

Home Page: https://shorts1999.github.io/pxt-smartmatrix/

License: MIT License

TypeScript 99.29% Makefile 0.71%

pxt-smartmatrix's Introduction

pxt-smartmatrix

Micro:Bit SmartMatrix

This extensions allows you to easily control LED matrices/displays made from ws2812b/NeoPixel controllable RGB LEDs There are a multitude of added cuntions, like drawing pixels in a x/y coördinante system, scrolling text over the display and drawing monochrome images.

IMPORTANT NOTE: The extension only works with matrices made in a "column-zigzag pattern" meaning the matrix is made of strips in a zig-zag pattern going up and down. The display can be any size you like, as long as the strips are laid out with this pattern in mind.

Current features and functions:

create (SmartMatrix.create). Create the matrix object, just like how you normally would create a normal neopixel strip. Select a digital pin to attach it to, the width and height of the matrix and the type of LED connected (RGB, RGBW RGB_RGB) "let matrix = SmartMatrix.create(digitalPin, matrixWidth, matrixHeight, LEDtype)"

brightness (matrix.Brightness(0-255)). set the brightness of the LEDs, just as you would in the NeoPixel library.

show (matrix.show()). Display all the changes made to the display, just as you would in the NeoPixel library.

clear (matrix.clear()). Remove everything from the display buffer. A call to matrix.show() must be made to make these changes visible!

setPixel (matrix.setPixel(X position, Y position, Colour)). set a specific pixel in the matrix to the specified colour. Call to matrix.show() must be made to make changes visible.

draw Bitmap (matrix.drawBitmap(bitmap, x offset, y offset, width, height, colour, direction) This function allows for drawing a monochrome bitmap on the display. it can be placed anywhere using the xoffset and yoffse. With direction you can either draw the bitmap normally or mirrored on the Y-axis.

Scroll Text (matrix.scrollText(text, speed, Y offset, colour) allows you to scroll a string of text across the matrix. this uses a 6x8 font, so every letter is 8 pixels tall and six pixels wide. the speed variable determines how fast it scrolls across the screen and the Y offset places it up or down on the screen.

To do:

  • Drawing graphics primitives like lines, squares and circles
  • support for other display types (non-zigzag, different start pixel positions etc)

TODO

  • Add a reference for your blocks here
  • Add "icon.png" image (300x200) in the root folder
  • Add "- beta" to the GitHub project description if you are still iterating it.
  • Turn on your automated build on https://travis-ci.org
  • Use "pxt bump" to create a tagged release on GitHub
  • On GitHub, create a new file named LICENSE. Select the MIT License template.
  • Get your package reviewed and approved https://makecode.microbit.org/extensions/approval

Read more at https://makecode.microbit.org/extensions

Supported targets

  • for PXT/microbit (The metadata above is needed for package search.)

pxt-smartmatrix's People

Contributors

shorts1999 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.