Pages: [1]   Go Down
Author Topic: [HOWTO] Write (almost) all you want using a 7 segment displayer  (Read 516 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I started to experiment Arduino a few days ago, and yesterday, I was handling a 7 segment displayer. I wanted to write a sentence on it, character after character, but I found it complicated to light a segment after another and to look on the internet what segment I should light to make a character. So I created a simple code (no really clean, but i works) that everyone can easily implement.

It works like that :
Code:
makeChar(aff, c, 7, cl, on, off);
* aff represent the 7 segment displayer and is an ordered array like aff[] = {A, B, C, D, E, F, G} where A, B, C... corresponds to the pin connected to each segment.
* c is the character to write for example : char c = 'A'
* cl is a boolean that determine if you want to clean what was written on the displayer (if you want to see your characters properly, set it to true)
* on is the state you gotta send on the pin to light the displayer up, you can set it to HIGH or LOW depending how you build your thing
* off is the state you gotta send on the pin to light the displayer off.

Note : you can't use the pin n°0.

Here's the code with an example : http://pastebin.com/mxAUntKu
Here, each thing you type using the serial communication will be displayed on the 7 segment displayer.

Logged

Pages: [1]   Go Up
Jump to: