Class Max7219
Max7219 LED matrix driver
public class Max7219
- Inheritance
-
Max7219
Constructors
Max7219(SpiDevice, int, RotationType)
Creates a Max7219 Device given a
public Max7219(SpiDevice spiDevice, int cascadedDevices = 1, RotationType rotation = RotationType.None)
Parameters
spiDevice
SpiDevicecascadedDevices
introtation
RotationType
Fields
NumDigits
Number of digits Register per Module
public const int NumDigits = 8
Field Value
SpiClockFrequency
MAX7219 Spi Clock Frequency
public const int SpiClockFrequency = 10000000
Field Value
SpiMode
MAX7219 SPI Mode
public const SpiMode SpiMode = Mode0
Field Value
Properties
CascadedDevices
Number of cascaded devices
public int CascadedDevices { get; }
Property Value
this[DeviceIdDigit]
Gets or Sets the value to the digit value for a given device and digit position
public byte this[DeviceIdDigit device] { get; set; }
Parameters
device
DeviceIdDigit
Property Value
this[int]
Gets or Sets the value to the digit value for a given absolute index
public byte this[int index] { get; set; }
Parameters
index
int
Property Value
Length
Gets the total number of digits (cascaded devices * num digits)
public int Length { get; }
Property Value
Rotation
The Rotation to be applied (when modules are assembled rotated way)
public RotationType Rotation { get; set; }
Property Value
Methods
Brightness(int)
Sets the brightness of all cascaded devices to the same intensity level.
public void Brightness(int intensity)
Parameters
intensity
intintensity level ranging from 0..15.
Clear(int, int, bool)
Clears the buffer from the given start to end (exclusive) and flushes
public void Clear(int start, int end, bool flush = true)
Parameters
ClearAll(bool)
Clears the buffer from the given start to end and flushes
public void ClearAll(bool flush = true)
Parameters
flush
bool
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Flush()
Writes all the Values to the devices.
public void Flush()
Init()
Standard initialization routine.
public void Init()
WriteBuffer(byte[][])
Writes a two dimensional buffer containing all the values to the devices.
public void WriteBuffer(byte[][] buffer)
Parameters
buffer
byte[][]