• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Make a Binary Clock...?

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?

1 Solution
Tommy HuiEngineerCommented:
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.
EmotionSicknessAuthor Commented:
Really no affence but duh...

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 !!
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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

EmotionSicknessAuthor Commented:
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, http://members.home.com/darkeclipse/files/bc2scrn.gif

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.

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.


Sorry, crossed wires there - I see my comment was completely off the mark too... sorry!
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.

EmotionSicknessAuthor Commented:
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. --- http://members.home.com/darkeclipse/files/binclock.zip (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

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now