Iot.Device.SenseHat.LedMatrixExt 1.0.2

dotnet add package Iot.Device.SenseHat.LedMatrixExt --version 1.0.2                
NuGet\Install-Package Iot.Device.SenseHat.LedMatrixExt -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Iot.Device.SenseHat.LedMatrixExt" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Iot.Device.SenseHat.LedMatrixExt --version 1.0.2                
#r "nuget: Iot.Device.SenseHat.LedMatrixExt, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Iot.Device.SenseHat.LedMatrixExt as a Cake Addin
#addin nuget:?package=Iot.Device.SenseHat.LedMatrixExt&version=1.0.2

// Install Iot.Device.SenseHat.LedMatrixExt as a Cake Tool
#tool nuget:?package=Iot.Device.SenseHat.LedMatrixExt&version=1.0.2                

Iot.Device.SenseHat.LedMatrixExt

NuGet

Extension methods of SenseHatLedMatrix to show unicode letter, message, or series values on Raspberry Pi Sense HAT running on Linux.

Getting started

  • Create a new console app (e.g. dotnet new console -o SenseHat.Sample).

  • Install Iot.Device.SenseHat.LedMatrixExt from NuGet (e.g. navigate inside the project directory and run dotnet add package Iot.Device.SenseHat.LedMatrixExt).

  • Explore the sample app SenseHat.QuickStart on how to build and run the app.

Extension methods of SenseHatLedMatrix

  • Clear LED Matrix
ledMatrix.Clear(Color? backColor = null)
  • Show a single letter (Unicode supported)
ledMatrix.ShowLetter(char letter, Color? foreColor = null, Color? backColor = null, Rotation rotation = Rotation.Rotate0)
  • Show a message (Unicode supported)
ledMatrix.ShowMessage(string message, Color? foreColor = null, Color? backColor = null, Rotation textRotation = Rotation.Rotate0, Direction scrollDirection = Direction.Left, int speedInMs = 90)
  • Show a series of values
ledMatrix.ShowSeriesValues(float[] values, Color? foreColor = null, Color? backColor = null, bool fill = false, Rotation rotation = Rotation.Rotate0, bool forward = true, int speedInMs = 90)

Unicode 8 x 8 Font

Built-in unicode characters

  • U+0000 - U+007F (basic latin)
  • U+00A0 - U+00FF (extended latin)
  • U+0390 - U+03C9 (greek characters)
  • U+3040 - U+309F (Hiragana)
  • U+2500 - U+257F (box drawing)
  • U+2580 - U+259F (block elements)
  • U+E541 - U+E55A (standard galactic alphabet)

Add custom characters

See section Encoding for glyph.

Font8x8.AddGlyph(char letter, byte[] glyph)

Encoding

Every character in the font is encoded row-wise in 8 bytes.

The most significant bit of each byte corresponds to the first pixel in a row.

The character 'A' (0x41 / 65) is encoded as { 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00 }

0x30 => 0011 0000 => ..XX....
0x78 => 0111 1000 => .XXXX...
0xCC => 1100 1100 => XX..XX..
0xCC => 1100 1100 => XX..XX..
0xFC => 1111 1100 => XXXXXX..
0xCC => 1100 1100 => XX..XX..
0xCC => 1100 1100 => XX..XX..
0x00 => 0000 0000 => ........

To access the nth pixel in a row, right-shift by 7-n.

                     . . X X . . . .
                     | | | | | | | |
(0x30 >> 7) & 1 == 0-+ | | | | | | |
(0x30 >> 6) & 1 == 0---+ | | | | | |
(0x30 >> 5) & 1 == 1-----+ | | | | |
(0x30 >> 4) & 1 == 1-------+ | | | |
(0x30 >> 3) & 1 == 0---------+ | | |
(0x30 >> 2) & 1 == 0-----------+ | |
(0x30 >> 1) & 1 == 0-------------+ |
(0x30 >> 0) & 1 == 0---------------+

Acknowledgements

Font8x8: https://github.com/dhepper/font8x8

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 363 1/13/2022
1.0.1 245 1/6/2022
1.0.0 259 1/6/2022