No tags
|
10 replies
Introduction
You get bored sat there waiting for that extra hardware to arrive to play around with the new toys and want something to do with your mbed???
Maybe Binary Clock!
Let me start for the uninitiated what is a binary clock, a binary clock is a regular clock, but the digits of the clock are represented in binary number format or Base2, we in general represent numbers in Base10.
so 19 in binary is 10011 (Hexadecimal or Base16 it is 0x13)
Basically the number is represented as follows:
Base10
10's 1's
1 9
Base2
16 8 4 2 1
1 0 0 1 1
16 + 2 + 1 = 19
Base16
16's 1's
1 3
(1*16) + (3*1) = 19
Its that simple
So for a binary clock the digits for the number are either on or off, therefore we can represent the numbers using on and off lights or in this case (as I had some lying around) LEDs.
Design
[TODO: Electronic Schematic]
BOM:
1 mbed
1 breadboard (don't waste vero or a pcb on this)
1 Blue LED (I used yellow as its all I had lying around)
6 LEDs (Not blue)
6 More LEDs (Not blue and not previous colour) (again didn't have enough)
13 1k resistors (one is missing and some are 720's due to lack of supplies)
More than likely some wire.
The electronics specifically use 1 resistor per LED, this is to maintain constant brightness of the LEDs.
// Define your outputs
DigitalOut Sec1(p5);
DigitalOut Sec2(p7);
DigitalOut Sec4(p9);
DigitalOut Sec8(p11);
DigitalOut Sec16(p13);
DigitalOut Sec32(p15);DigitalOut Min1(p30);
DigitalOut Min2(p28);
DigitalOut Min4(p26);
DigitalOut Min8(p24);
DigitalOut Min16(p22);
DigitalOut Min32(p21);DigitalOut Hour1(LED4);
DigitalOut Hour2(LED3);
DigitalOut Hour4(LED2);
DigitalOut Hour8(LED1);
DigitalOut Hour16(p20);
Pins are spaced out by 2 as I used 5mm LEDs and this is so they will fit more easily.

[TODO: Process Flow]
The RTC is set from the Serial port via USB channel.
Software
[TODO: Detail Software]
Please log in to post a comment.
You can use BusOut instead of several DigitalOuts if you need to toggle several pins at once.