Gadgets My Applications Programing Technology

Drive a 7-Segment LED with an Arduino

Last week I took a day off work and started experimenting with Arduino. Arduino is an open-source electronics prototyping platform that enables anyone to create interactive objects. During the week I started doing basic stuff using simple components such as blinking LEDs and playing tunes with a buzzer, and yesterday I experimented with multiple LEDs. After that I wanted to try and do something with a 7-Segment LED display so I found this tutorial that enabled me to make the circuit and learn the code that should drive the display.

Unfortunately the provided code did not work and I had to modify a lot of parts to finally get the display to work. I had to invert the “HIGH” and “LOW” params in all the function calls and change the way the constants are defined in the beginning.

I can’t really explain to you why there is such a difference between my working code and the code provided in the article I based myself on since I’m still a beginner. I might be using a different display and a different version of the IDE. When I’m advanced enough to figure that out I’ll make sure to update the article. If you can explain the reason to me please do so in the comments.

Here’s the updated code, I also created an additional function that plays a little “snake” animation on the display.

My Applications

A Digital Ruler

A lot of time when I am modifying or making a site, I need to get the width and height of a certain area of the screen. Usually I used to take a screenshot of the screen, go to photoshop and cut the area I need to see the size of it, but that used to take time so yesterday I made this little tool that does the job for me.

It is a window with an empty area in it, just put the window around anything you want to measure and it will give you the size of it directly (in Pixels). You can also set the window to take a certain size you need or change its color.

Here’s a Picture of the Digital Ruler running:

ruler screenshot

To download and run the program you need to agree to its EULA, If the program doesn’t run you probably don’t have the .Net Framework 2.0 (available in most computers running Vista and XP) so download it from here.


My Applications Software

Morse Code Translator V1.0

Morse Code Translator V1.0 is a small and easy to use program I wrote last semester that can translate text to and from Morse code, The program can also “read” Morse code and convert existing Morse code to a code that can be understood by it.

Screen shot:

Morse Code Translator Preview


-Text Input and Output

You can modify Input text in different ways:
1- Directly writing in the text-box.
2- Paste input text by pressing CTRL+V or by going to Edit > Paste Input.
3- By selecting “Clear Input text” in the “After Conversion settings”
4- By selecting “Clear Input” in the Edit Menu.

You can use the Output text in different ways:
1- By selecting “Cut Output” and “Copy Output” in the Edit Menu
2- By selecting “Clear Output” in the Edit Menu.
3- By selecting “Copy Output text” in the “After Conversion settings”


First you must choose the type of translation (Morse to Text or Text to Morse) after that you can change those settings:

A- Morse Code to use:

1- Letters and Numerals (A to Z, 0 to 9) will be used by default during translations; all other letters will be replaced by a character or a word you choose.
This option cannot be deselected
2- You can choose to deselect the usage of Punctuation and Prosigns, if you do this all other letters will be replaced by a character or a word you choose.

B- Character replacement

If the program doesn’t recognize a letter during translation it will replace with a word or a sign of your choice, you can select one of the preset words or letters or enter your personal replacement.

C- After Conversion
After the program finishes converting the text, it can perform any operation chosen at this point, if you select “Copy Morse Code” it will copy the generated translation, if you choose “Clear Input Text” it will clear the input text


M-Player is a little tool that allows you to play the Morse Code, to use it select where it should read from and press play.
Note that once Morse Playing starts, it cannot be stopped. (Will be fixed in an upcoming version)

-Morse Code Converter

Morse Code Converter is a tool that lets you convert any Morse Code to a Morse Code that can be used in the Morse Code Translator.
You can choose the Auto Conversion Mode, in this mode the Converter will try to detect each character and convert it, If this mode doesn’t work, you can choose your settings manually.
The converted code will be pasted in the Input Box of the Morse Code Converter.

-Minimum Requirements:

To run the Morse Code Translator you must have the .Net Framework (Already available in most computers running XP and Vista) so download it if the program doesn’t start.


Please use the comment section to ask a question about the Morse Code Translator.


To Use the program you must agree to its EULA.