Click here to Skip to main content
Licence CPOL
First Posted 2 Mar 2010
Views 43,625
Downloads 2,755
Bookmarked 171 times

A C# LED matrix display

By | 4 Apr 2010 | Article
A C# user control which displays texts or symbols as if they were displayed on an LED matrix screen.

Description

This article introduces a C# user control which displays texts or symbols as if they were displayed on an LED matrix screen. The control manages several items, an item defined by its text, its direction, and its speed. The goal of the article is to describe the key points of the control; it's not a strictly technical explanation. There are no technical difficulties. The control is presented in an application that allows the user to manage two text items.

Key points

Mutli-display items

The control manages the display of an item list. Aan item is associated to an array which defines the LED "On" and position (X, Y) on the display. On a "PaintEvent", each LED on the display is analysed to know if there is an "LedOn" point among the items that corresponds to the LED.

Shema.JPG

Custom font file

To build the "LedOn" array of an item from a text string, the control introduces a conversion function which gives the LED On array via a symbol code as an input. The function uses an XML file as the translation file from the code to the symbol. Actually, the control introduces an example file in the resources of the project. The code used is the ASCII code. Each symbol in the file is defined by the LED "On" on its lines (the LED "On" is represented by a #).

<LedMatrixSymbol SymbolCode="71" Description="G">
    <LedLine LineNumber="0" LineLedOn="_______"/>
    <LedLine LineNumber="1" LineLedOn="__###__"/>
    <LedLine LineNumber="2" LineLedOn="_#___#_"/>
    <LedLine LineNumber="3" LineLedOn="_#_____"/>
    <LedLine LineNumber="4" LineLedOn="_#_____"/>
    <LedLine LineNumber="5" LineLedOn="_#__##_"/>
    <LedLine LineNumber="6" LineLedOn="_#___#_"/>
    <LedLine LineNumber="7" LineLedOn="__###__"/>
</LedMatrixSymbol>

Modification on the flow

The properties of each item (LED "On" array, speed, and direction) can be changed at any time. The properties of the display (LED colours and matrix size) are also modifiable.

LED size management

In the first version of the code, the LED size was deducted by a simple way. Each LED cell was divided in six equals parts: 1 for the border on the left (top), 4 for the LED, and 1 for the border on the right (down). This way, the minimum size for an LED cell was 6 pixels.

PrevLedSz.JPG

In the new version, the LED cell is not divided in sections. The part of the LED diameter in the LED cell is not defined by code (2/3 in previous version) but by a coefficient as a new parameter of the control. So the ratio between the border and the LED can be set from 0 to 1.

NewLedSz.JPG

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Chootair

Engineer

France France

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionHow to use it ? Pinmembervincennes12:02 15 Apr '12  
GeneralMy vote of 3 PinmemberJulien Villers23:32 18 Dec '11  
GeneralMy vote of 5 PinmemberAddy Tas0:43 8 Dec '11  
GeneralMy vote of 3 PinmvpDave Kreskowiak6:14 5 Dec '11  
QuestionFont to led implementation PinmemberNimea21:44 25 Sep '11  
GeneralBug in idle scrolling? Otherwise, Awesome! PinmemberStuart Rubin9:10 27 May '11  
GeneralMy vote of 5 Pinmembercraliaga9:44 20 May '11  
GeneralMy vote of 5 PinmemberXantilon23:05 17 Jan '11  
GeneralMy vote of 5 PinmemberSrikanth031:01 9 Dec '10  
GeneralA C# LED matrix display Pinmemberaleribrib7:03 6 Sep '10  
GeneralA C# LED matrix display Pinmemberaleribrib4:46 3 Sep '10  
GeneralRe: A C# LED matrix display PinmemberChootair1:22 6 Sep '10  
QuestionHow to use UNICODE? Pinmemberjbahn15:08 22 Aug '10  
QuestionHow to support Chinese? Pinmember432848317:04 16 May '10  
AnswerRe: How to support Chinese? Pinmembersilas_yao4:35 18 Feb '11  
GeneralGood Job Pinmemberlamasmg200221:38 12 May '10  
GeneralERROR Pinmemberlamasmg200221:37 12 May '10  
Generala simpler way PinmemberAbdollah Zawari5:25 18 Apr '10  
GeneralExcellent work Pinmemberradar_ksa23:34 17 Apr '10  
GeneralExtraordinary PinmemberPavan Nagumalli19:20 13 Apr '10  
GeneralNow that is cool! PinmemberPhilip F.11:34 4 Apr '10  
QuestionMake the LED bigger? Pinmemberanga2:05 9 Mar '10  
AnswerRe: Make the LED bigger? PinmemberChootair8:39 4 Apr '10  
Generalvery nice, but an error in symbol code 44 Pinmemberwima19:35 8 Mar '10  
GeneralRe: very nice, but an error in symbol code 44 PinmemberChootair8:41 4 Apr '10  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 4 Apr 2010
Article Copyright 2010 by Chootair
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid