This is a class library which facilitates easy manipulation of LED displays driven by the MAX7219 chip over a Serial Peripheral interface (SPI). The library is designed to be lightweight and is targeted at .NET 7, utilizing Microsoft's System.Device.Spi library to interface with the device.
The purpose of this program is to enable the quick and easy usage of off-the-shelf MAX7129 displays, primarily on platforms such as the Raspberry Pi.
Download and install the package using NuGet:
dotnet add package MAX7219Sharp --version 1.0.0
You can also use the Package Manager Console:
PM> NuGet\Install-Package MAX7219Sharp -Version 1.0.0
MAX7219 Pin | RPi Pin | Description |
---|---|---|
VCC | 2 (+5V) | 5V power supply |
GND | 6 (GND) | Ground |
DIN | 19 (MOSI) | Data in |
CS | 24 (SPI CE0) | Chip Select 0 |
CLK | 23 (SPI CLK) | Clock |
A simple example of how to use the library is shown below:
using MAX7219Sharp;
Console.WriteLine("Writing HELLO to display");
var device = new MAX7219();
device.Write("HELLO");
Thread.Sleep(1000);
device.ClearDisplay();
Console.WriteLine("Press any key to exit");
Console.ReadKey();
Please see the DisplayDemo project for a more in-depth example, and/or to provide a starting point for your own code.