Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Make a Binary Clock...?

Posted on 1999-07-28
Medium Priority
Last Modified: 2011-10-03
Around the internet I see all different programs that have the time in BINARY format using "drawn" diodes or whatever... Anyway, I was wondering how I might make my own BINARY clock?

Question by:EmotionSickness
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Expert Comment

by:Tommy Hui
ID: 1528161
You have basically three choices:

1. Draw the diodes yourself using the graphics API. This requires the most amount of work.

2. Get the bitmaps for the numbers from the Internet. Then you can use the bitmap control to display the numbers.

3. Get the font from the Internet. Then you can use the font in a text control.

Author Comment

ID: 1528162
Really no affence but duh...

LVL 10

Expert Comment

ID: 1528163
What do you mean by binary ?? can you give an example ??

ThisTime = format$(now,"hh:mm")
will give 08:16

Do you mean analogue ?? i.e. with a big hand and a little hand ???

I cannot imagine a binary clock, binary implies two (bi) state, so it would either be time for a beer or time for a ..nother beer !!
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Expert Comment

ID: 1528164
What about sex, that has to be the other time.


Author Comment

ID: 1528165
Binary is basically when patterns of little lights or dots represent the time (or a timer or something).

This is a Shareware binary clock program I found as an example.


If you just want a picture to get the "rough" idea,

And it was time for a beer or three a LONG time ago for me.  AND i'm not even gonna get into my problems (actually her problems... :| ) with "simonsabin"'s OTHER TIME that he mentioned...  Oh hell, you didn't need to hear that.
LVL 10

Expert Comment

ID: 1528166

No offence either, but if you ask a vague question, don't get snotty if you don't get the right answer.

Yep. We would need an explanation of what exactly a binary clock is.

On the other hand though, it shouldn't really matter that much.

Take any Date/Time value - e.g. the value "Now"

You can move this to a double, and remove the integer part:

Dim dblNow As Double

dblNow = Now
dblNow = dblNow - Int(dblNow)

Now you have the current time expressed as a fraction of a day. E.g. 06:00 would be 0.25, 12:00 would be 0.5 and 18:00 would be 0.75

You can now convert this to any format you like. Want to divide the day into 7 hours of 43 minutes each?

dblHr7 As Double
intHr7 As Integer
dblMn43 As Double
intMn43 As Integer

dblHr7 = 7 * dblNow
intHr7 = int(dblHr7)

dblMn43 = dblHr7 - intHr7
dblMn43 = dblMn43 * 43
intMn43 = int(dblMn43)

MsgBox "Current time in the 7Hour43Minute system = " & CStr(intHr7) & ":" & CStr(intMn43)

I still have no idea what you mean by your "binary" system, but hopefully the above should give you an inkling on how to solve your problem.


LVL 10

Expert Comment

ID: 1528167
Sorry, crossed wires there - I see my comment was completely off the mark too... sorry!
LVL 10

Accepted Solution

caraf_g earned 800 total points
ID: 1528168
Ok - got the solution.

If you look at each column of 4 "diodes", you'll see that the bottom one = 1, the next one up = 2, the next one = 4, and the last one = 8.

So, looking at your example .gif, which shows the time 05:12:26, the lights are as follows:

Column 01 - "0" - All diodes are off
Column 02 - "5" - Diodes 1 and 3, corresponding with 1 + 4 = 5
Column 03 - "1" - Diode 1
Column 04 = "2" - Diode 2
Column 05 = "2" - Diode 2
Column 06 = "6" - Diodes 2 and 3, i.e. 2 + 4 = 6.

So, for each digit, convert to binary as follows
0 = 0000
1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
and set the diodes in the column accordingly.


Author Comment

ID: 1528169
Whoa damn... Took me awhile but I finished a program that tells the time in Binary! Thanks alot for your help.  Obviously cause I rushed it, the program's not pretty and I was using Command buttons for the lights, but if anyone would like to see a picture of what I ended up with. --- (2.15 Kb)

Sorry it's in BMP format, too lazy to convert it, but not too lazy as to not atleast zip it or something.

Thanx again!

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question