A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matrix displays.
This is a simple seven segment library that let you display char / numbers, or any sequance you need to multiple display.
It runs both on common anode, and common cathode display.
I've used a lookup table to convert ascii table. Also a function to display any sequence you want is available.
Below you can find sample schematics to run multiple diasplay.
The full transistor version let you run disaply at your desired voltage.
7 segment common cathode schematics example
7 segment common anode schematics example
7 segment common cathode with full transistor schematics example
7 segment common anode with full transistor schematics example
Code
- download at: avr_lib_sevseg_03.zip
download at: avr_lib_sevseg_01.zip
Notes
- read risk disclaimer
- excuse my bad english
Thank you very much
ReplyDeleteHappy to ear that this project helps someone :)
DeleteDear Davide,
DeleteCan we use for displaying float values on 7-segment.
yes, you just have to use the dot of the 7-segment.
DeleteThis comment has been removed by the author.
DeleteHi Davide,
ReplyDeleteI would like to use your library in a project of mine, where need show 3-digi-long numbers.
However, I encountered some difficulties understanding even how to simply put a character on a particular display. I extended SEVSEG_PINDISPA array with SEVSEG_PINDISP3 assigned to according pin, but I can't seem to get consistent behavior anyway.
sevseg_putc(char character, char dot) - this is clear, but how I select the display?
Also, I assume, to be able to show characters on multiple displays, it has to run in cycle?
Would you care to explain a bit deeper, how the library is intended to use?
Best regards,
Alex
Hello,
Deleteat first, i suggest to use code, as is, then, when it works, to extend the number of display involved, i.e. to extend the array.
sevseg_putc just put a character on the selected display.
sevseg_selnextdisplay switch to next display.
To display character on multiple display you need to loop, it is correct.
Take a look at the sample in the main.c file.
If you do not want to loop, due to resource usage, you can use the MAX7219 IC. Here you can find my implementation on that IC: http://davidegironi.blogspot.it/2013/07/avr-atmega-max7219-7-segment-led-matrix.html