Git Product home page Git Product logo

led-matrix's Introduction

led-matrix

The LED Matrix library allows you to easily interact with an 8x8 LED Matrix using .NET

Feature highlights:

  • Write Bitmaps to display
  • Write byte arrays to display
  • Clear display
  • Set rows
  • Set Columns

And more helpful features

Setup:

To use the LedMatrix you first grab the dll file above, and put it into your project. For more information on how to set up a dll file, refer here.

You also have to set up the LedControl library. How?

Grab the zip file from that repo, then in the Arduino IDE, navigate to:

Sketch > Include Library > Add .ZIP Library. Then select "Add .ZIP Library".

Find the .ZIP file, select it, paste the "ledcontrol.ino" file into the IDE, and you're good to upload.

For more information on .ZIP libraries, refer here.

Getting started

Initialize Display

LedMatrix(string comPort, int baudRate, int din, int cs, int clk, int brightness)

LedMatrix lm = new LedMatrix("COM8", 9600);
// --stuff--

Hello World

LedMatrix lm = new LedMatrix("COM8", 9600);
byte[] data = {
  0b10101010,
  0b01010101,
  0b00000000,
  0b00000000,
  0b00000000,
  0b00000000,
  0b00000000,
  0b00000000
};
lm.Write(data);
stuff

Write(byte[] data)

Write(string filePath, int pixelSize)

Takes an array of bytes and writes the bytes to the ledmatrix display.

LedMatrix lm = new LedMatrix("COM8", 9600);
lm.Write(new byte[] {
  0b10101010,
  0b01010101,
  0b00000000,
  0b00000000,
  0b00000000,
  0b00000000,
  0b00000000,
  0b00000000
});

Takes a filepath to a bitmap as well as the pixelwidth, converts to a byte array, then writes the data to the ledmatrix display.

LedMatrix lm = new LedMatrix("COM8", 9600);
lm.Write("C:\dev\my_img.png", 1);

ClearScreen()

Sets all leds on the display to off

LedMatrix lm = new LedMatrix("COM8", 9600);
lm.ClearScreen();

SetRow(int row, byte value)

Takes a row and a byte to write to the row, each bit corresponding to an LED

LedMatrix lm = new LedMatrix("COM8", 9600);
lm.SetRow(5, 0b00101010);

SetColumn(int column, byte value)

Takes a row and a byte to write to the column, each bit corresponding to an LED

LedMatrix lm = new LedMatrix("COM8", 9600);
lm.SetColumn(5, 0b00101010);

WriteAnimation(string filePath, int frameDelay, int pixelSize)

Takes the path to the .gif, the length of time before the next frame, and the pixel size.

LedMatrix lm = new LedMatrix("COM8", 9600);
lm.WriteAnimation("C:\dev\my_gif.gif", 1000, 1);

led-matrix's People

Contributors

jlhs1001 avatar

Stargazers

Dave Teske avatar  avatar Heith Seewald avatar

Watchers

 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.