Go Down

Topic: Display a string in 7 segment display from serial read(A100) (Read 118 times) previous topic - next topic


I want to read data from Serial input and display the value in Seven Segment display.
Like input from Serial - A10
Display in 7 Segment display should be - A10
Internally all the values convert into ASCII. like 1 -> 49 , A -> 65 etc.
Could anyone help me or guide me how to proceed?


Lets start with your  hardware. How are the displays connected? Is it a 3-unit display with common segment lines? Are the digits common-anode or common-cathode?

Are the digits coming in as ASCII letters?  www.asciitable.com
I.e, 0 to 9 are 0x30 to 0x39 (decimal 48 to 57) while letter A to F are one set and a to f are another.

So you wait for a letter to come in, read it and subtract the appropriate amount depending on the range it was in, and send it to the display, or wait for 2 more, or wait until an ending character is received (such as Carriag Return, 0x0D), and ignoring any characters that are out of those ranges.

Once you have 3, or 1 or 2 and the end character, display them.

Make a font lookup table that will map the letters to the LED segments

byte fontTable[] = {
0b00111111, // 0  1 = segment on, DP-g-f-e-d-c-b-a
0b00000110, // 1
0b01011011, // 2

with segments layed out as:
f          b
e         c
      d        DP if used

Send those to the hardware:
LEDsegments = fontTable[characterToDisplay];
Sending will depend on the hardware set up, and if you are multiplexing or not.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Hi Sir,

Yes it is common segment line. all the display connected parallel and it is common cathode.
How to select the CharacterToDisplay from Array?


Please let me know how to separate the character from one another if we pass alphanumeric value like A1?


I think we would need to see your code - posted according to the instructions - in order to work any further.

Go Up