Introduction: Old Laptop (or Pc) Into a Clock.

Picture of Old Laptop (or Pc) Into a Clock.
This might be extravagant, but if you take an old 486 or 386 laptop without a hard drive then you can easily turn it into a crazy clock. We have an old Compaq 486 laptop that uses only a few watts. The code for this program will work on most platforms that have some kind of basic compiler. I plan to make a bash version that will work on text terminals also. May make versions that will work on the apple and the android platforms. In any case it should make an interesting conversation piece and save one more computer from the landfill.

Update: added digital clock that may be updated later to be a bit prettier.


Note: update coming to add an alarms feature.

Step 1: What You Need.

Picture of What You Need.

An old low power laptop with bootable floppy drive.
Bootable dos floppy.
Qbasic or freebasic compiler.
The code.

Step 2: Compile the Code.

Picture of Compile the Code.

Compile the following code in the qb45 or freebasic compiler.  (c:\>fbc -lang qb clock.bas)

[code]
'UNSEEN'S NOT A STANDARD CLOCK
DIM SEC AS STRING, MIN AS STRING, HR AS STRING
SCREEN 0: COLOR 3, 15: WIDTH 40, 25
CLS
DO
HR$ = LEFT$(TIME$, 2): MIN$ = MID$(TIME$, 4, 2): SEC$ = RIGHT$(TIME$, 2)
LOCATE 1, 1: PRINT HR$; ":"; MIN$; ":"; SEC$
'MINUTES
IF (VAL(MIN$) <  10 and val(min$) >= 5) OR (VAL(MIN$) >= 55 AND VAL(MIN$) < 60) THEN COLOR 12, 15
LOCATE 3, 2: PRINT "FIVE": COLOR 3, 15
IF VAL(MIN$) >= 10 AND VAL(MIN$) < 15 OR VAL(MIN$) >= 50 AND VAL(MIN$) < 55 THEN COLOR 12, 15
LOCATE 3, 8: PRINT "TEN": COLOR 3, 15
IF VAL(MIN$) >= 15 AND VAL(MIN$) < 20 OR VAL(MIN$) >= 45 AND VAL(MIN$) < 50 THEN COLOR 12, 15
LOCATE 3, 13: PRINT "FIFTEEN": COLOR 3, 15
IF VAL(MIN$) >= 20 AND VAL(MIN$) < 25 OR VAL(MIN$) >= 40 AND VAL(MIN$) < 45 THEN COLOR 12, 15
LOCATE 3, 21: PRINT "TWENTY": COLOR 3, 15
IF VAL(MIN$) >= 25 AND VAL(MIN$) < 30 OR VAL(MIN$) >= 35 AND VAL(MIN$) < 40 THEN COLOR 12, 15
LOCATE 3, 28: PRINT "TWENTY FIVE": COLOR 3, 15
LOCATE 7, 12: PRINT "MIN'S"
'EXTRA MINUTES
IF VAL(MIN$) > 30 THEN COLOR 12, 15
LOCATE 5, 3: PRINT "MINUS": COLOR 3, 15
IF VAL(MIN$) < 30 THEN COLOR 12, 15
LOCATE 5, 10: PRINT "PLUS": COLOR 3, 15
IF VAL(MID$(TIME$, 5, 1)) = 6 OR VAL(MID$(TIME$, 5, 1)) = 4 THEN COLOR 12, 15
LOCATE 7, 3: PRINT "1": COLOR 3, 15
IF VAL(MID$(TIME$, 5, 1)) = 7 OR VAL(MID$(TIME$, 5, 1)) = 3 THEN COLOR 12, 15
LOCATE 7, 5: PRINT "2": COLOR 3, 15
IF VAL(MID$(TIME$, 5, 1)) = 8 OR VAL(MID$(TIME$, 5, 1)) = 2 THEN COLOR 12, 15
LOCATE 7, 7: PRINT "3": COLOR 3, 15
IF VAL(MID$(TIME$, 5, 1)) = 9 OR VAL(MID$(TIME$, 5, 1)) = 1 THEN COLOR 12, 15
LOCATE 7, 9: PRINT "4": COLOR 3, 15
'TO PAST
IF VAL(MIN$) > 30 THEN COLOR 12, 15
LOCATE 9, 10: PRINT "TO THE NEXT HOUR": COLOR 3, 15
IF VAL(MIN$) <= 30 THEN COLOR 12, 15
LOCATE 9, 30: PRINT "PAST": : COLOR 3, 15
IF VAL(MIN$) = 30 THEN COLOR 12, 15
LOCATE 9, 36: PRINT "HALF ": COLOR 3, 15
'HOURS
IF VAL(HR$) = 1 OR VAL(HR$) = 13 THEN COLOR 12, 15
LOCATE 11, 2: PRINT "ONE": COLOR 3, 15
IF VAL(HR$) = 2 OR VAL(HR$) = 14 THEN COLOR 12, 15
LOCATE 11, 7: PRINT "TWO": COLOR 3, 15
IF VAL(HR$) = 3 OR VAL(HR$) = 15 THEN COLOR 12, 15
LOCATE 11, 12: PRINT "THREE": COLOR 3, 15
IF VAL(HR$) = 4 OR VAL(HR$) = 16 THEN COLOR 12, 15
LOCATE 11, 19: PRINT "FOUR": COLOR 3, 15
IF VAL(HR$) = 5 OR VAL(HR$) = 17 THEN COLOR 12, 15
LOCATE 11, 25: PRINT "FIVE": COLOR 3, 15
IF VAL(HR$) = 6 OR VAL(HR$) = 18 THEN COLOR 12, 15
LOCATE 11, 30: PRINT "SIX": COLOR 3, 15
IF VAL(HR$) = 7 OR VAL(HR$) = 19 THEN COLOR 12, 15
LOCATE 11, 35: PRINT "SEVEN": COLOR 3, 15
IF VAL(HR$) = 8 OR VAL(HR$) = 20 THEN COLOR 12, 15
LOCATE 12, 5: PRINT "EIGHT": COLOR 3, 15
IF VAL(HR$) = 9 OR VAL(HR$) = 21 THEN COLOR 12, 15
LOCATE 12, 12: PRINT "NINE": COLOR 3, 15
IF VAL(HR$) = 10 OR VAL(HR$) = 22 THEN COLOR 12, 15
LOCATE 12, 18: PRINT "TEN": COLOR 3, 15
IF VAL(HR$) = 11 OR VAL(HR$) = 23 THEN COLOR 12, 15
LOCATE 12, 23: PRINT "ELEVEN": COLOR 3, 15
IF VAL(HR$) = 0 OR VAL(HR$) = 12 THEN COLOR 12, 15
LOCATE 12, 31: PRINT "TWELVE": COLOR 3, 15
'AM-PM
IF VAL(HR$) >= 12 THEN COLOR 12, 15
LOCATE 16, 5: PRINT "PM": COLOR 3, 15
IF VAL(HR$) < 12 THEN COLOR 12, 15
LOCATE 16, 2: PRINT "AM": COLOR 3, 15
'SECONDS
COLOR 12, 15: LOCATE 19, 2: PRINT "AND"
COLOR 3, 15
IF VAL(SEC$) = 5 THEN COLOR 12, 15
LOCATE 21, 1: PRINT "5": COLOR 3, 15
IF VAL(SEC$) = 10 THEN COLOR 12, 15
LOCATE 21, 3: PRINT "10": COLOR 3, 15
IF VAL(SEC$) = 15 THEN COLOR 12, 15
LOCATE 21, 7: PRINT "15": COLOR 3, 15
IF VAL(SEC$) = 20 THEN COLOR 12, 15
LOCATE 21, 11: PRINT "20": COLOR 3, 15
IF VAL(SEC$) = 25 THEN COLOR 12, 15
LOCATE 21, 15: PRINT "25": COLOR 3, 15
IF VAL(SEC$) = 30 THEN COLOR 12, 15
LOCATE 21, 19: PRINT "30": COLOR 3, 15
IF VAL(SEC$) = 35 THEN COLOR 12, 15
LOCATE 21, 23: PRINT "35": COLOR 3, 15
IF VAL(SEC$) = 40 THEN COLOR 12, 15
LOCATE 21, 27: PRINT "40": COLOR 3, 15
IF VAL(SEC$) = 45 THEN COLOR 12, 15
LOCATE 21, 31: PRINT "45": COLOR 3, 15
IF VAL(SEC$) = 50 THEN COLOR 12, 15
LOCATE 21, 35: PRINT "50": COLOR 3, 15
IF VAL(SEC$) = 55 THEN COLOR 12, 15
LOCATE 21, 39: PRINT "55": COLOR 3, 15
COLOR 12, 15: LOCATE 23, 32: PRINT "SECONDS"
COLOR 3, 15
LOOP
[/code]


Note you could add a section for alarms that reads in a text file of future alarms in the code if you wanted to but the program would have to be recompiled.

Step 3: Digital Clock

Picture of Digital Clock

Compile the following code in the qb45 or freebasic compiler.  (c:\>fbc -lang qb digiclock.bas). We used the banner, toilet, and the figlet commands on linux to get the ascii art we needed. Preparing the ascii art was the hardest part of the program. Rest was simple.


[code]
'=====================================================================
' thetimeis
' author: computothought
'---------------------------------------------------------------------
' housekeeping
' arrays
dim blank$(7)
dim num$(10,10)
dim colon$(7)

' data
num$(0, 1) = "  ###  "
num$(0, 2) = " #   # "
num$(0, 3) = "# #   #"
num$(0, 4) = "#  #  #"
num$(0, 5) = "#   # #"
num$(0, 6) = " #   # "
num$(0, 7) = "  ###  "

num$(1, 1) = "   #   "
num$(1, 2) = "  ##   "
num$(1, 3) = " # #   "
num$(1, 4) = "   #   "
num$(1, 5) = "   #   "
num$(1, 6) = "   #   "
num$(1, 7) = " ##### "

num$(2, 1) = " ##### "
num$(2, 2) = "#     #"
num$(2, 3) = "      #"
num$(2, 4) = " ##### "
num$(2, 5) = "#      "
num$(2, 6) = "#      "
num$(2, 7) = "#######"

num$(3, 1) = " ##### "
num$(3, 2) = "#     #"
num$(3, 3) = "      #"
num$(3, 4) = " ##### "
num$(3, 5) = "      #"
num$(3, 6) = "#     #"
num$(3, 7) = " ##### "

num$(4, 1) = "#      "
num$(4, 2) = "#    # "
num$(4, 3) = "#    # "
num$(4, 4) = "#######"
num$(4, 5) = "     # "
num$(4, 6) = "     # "
num$(4, 7) = "     # "

num$(5, 1) = "#######"
num$(5, 2) = "#      "
num$(5, 3) = "#      "
num$(5, 4) = " ##### "
num$(5, 5) = "      #"
num$(5, 6) = "#     #"
num$(5, 7) = " ##### "

num$(6, 1) = " ##### "
num$(6, 2) = "#     #"
num$(6, 3) = "#      "
num$(6, 4) = "###### "
num$(6, 5) = "#     #"
num$(6, 6) = "#     #"
num$(6, 7) = " ##### "

num$(7, 1) = "#######"
num$(7, 2) = "#    # "
num$(7, 3) = "    #  "
num$(7, 4) = "   #   "
num$(7, 5) = "  #    "
num$(7, 6) = "  #    "
num$(7, 7) = "  #    "

num$(8, 1) = " ##### "
num$(8, 2) = "#     #"
num$(8, 3) = "#     #"
num$(8, 4) = " ##### "
num$(8, 5) = "#     #"
num$(8, 6) = "#     #"
num$(8, 7) = " ##### "

num$(9, 1) = " ##### "
num$(9, 2) = "#     #"
num$(9, 3) = "#     #"
num$(9, 4) = " ######"
num$(9, 5) = "      #"
num$(9, 6) = "#     #"
num$(9, 7) = " ##### "

colon$(1) = "  # "
colon$(2) = " # #"
colon$(3) = "  # "
colon$(4) = "    "
colon$(5) = "  # "
colon$(6) = " # #"
colon$(7) = "  # "

'--------------------------------------------------------------------
'the logic
cls
locate 10,2: print"                                                                            #"
locate 11,2: print"  #####  #    #  ######     #####     #    #    #  ######    #     ####    # #"
locate 12,2: print"    #    #    #  #            #       #    ##  ##  #         #    #         #"
locate 13,2: print"    #    ######  #####        #       #    # ## #  #####     #     ####"
locate 14,2: print"    #    #    #  #            #       #    #    #  #         #         #    #"
locate 15,2: print"    #    #    #  #            #       #    #    #  #         #    #    #   # #"
locate 16,2: print"    #    #    #  ######       #       #    #    #  ######    #     ####     #"
locate 17,2: print ""

locate 20,20: print colon$(1);
locate 21,20: print colon$(2);
locate 22,20: print colon$(3);
locate 23,20: print colon$(4);
locate 24,20: print colon$(5);
locate 25,20: print colon$(6);
locate 26,20: print colon$(7);

locate 20,50: print colon$(1);
locate 21,50: print colon$(2);
locate 22,50: print colon$(3);
locate 23,50: print colon$(4);
locate 24,50: print colon$(5);
locate 25,50: print colon$(6);
locate 26,50: print colon$(7);


true% = -1
while true%

hrl$ = mid$(TIME$, 1,1): minl$ = MID$(TIME$, 4, 1): secl$ = mid$(TIME$, 7,1)
hrr$ = mid$(TIME$, 2,1): minr$ = MID$(TIME$, 5, 1): secr$ = mid$(TIME$, 8,1)

' hour left
    locate 20,1: print num$(val(hrl$), 1);
    locate 21,1: print num$(val(hrl$), 2);
    locate 22,1: print num$(val(hrl$), 3);
    locate 23,1: print num$(val(hrl$), 4);
    locate 24,1: print num$(val(hrl$), 5);
    locate 25,1: print num$(val(hrl$), 6);
    locate 26,1: print num$(val(hrl$), 7);

'hour right
    locate 20,10: print num$(val(hrr$), 1);
    locate 21,10: print num$(val(hrr$), 2);
    locate 22,10: print num$(val(hrr$), 3);
    locate 23,10: print num$(val(hrr$), 4);
    locate 24,10: print num$(val(hrr$), 5);
    locate 25,10: print num$(val(hrr$), 6);
    locate 26,10: print num$(val(hrr$), 7);

'minute left
    locate 20,30: print num$(val(minl$), 1);
    locate 21,30: print num$(val(minl$), 2);
    locate 22,30: print num$(val(minl$), 3);
    locate 23,30: print num$(val(minl$), 4);
    locate 24,30: print num$(val(minl$), 5);
    locate 25,30: print num$(val(minl$), 6);
    locate 26,30: print num$(val(minl$), 7);

'minute right
    locate 20,40: print num$(val(minr$), 1);
    locate 21,40: print num$(val(minr$), 2);
    locate 22,40: print num$(val(minr$), 3);
    locate 23,40: print num$(val(minr$), 4);
    locate 24,40: print num$(val(minr$), 5);
    locate 25,40: print num$(val(minr$), 6);
    locate 26,40: print num$(val(minr$), 7);

'second left
    locate 20,60: print num$(val(secl$), 1);
    locate 21,60: print num$(val(secl$), 2);
    locate 22,60: print num$(val(secl$), 3);
    locate 23,60: print num$(val(secl$), 4);
    locate 24,60: print num$(val(secl$), 5);
    locate 25,60: print num$(val(secl$), 6);
    locate 26,60: print num$(val(secl$), 7);

'Second right
    locate 20,70: print num$(val(secr$), 1);
    locate 21,70: print num$(val(secr$), 2);
    locate 22,70: print num$(val(secr$), 3);
    locate 23,70: print num$(val(secr$), 4);
    locate 24,70: print num$(val(secr$), 5);
    locate 25,70: print num$(val(secr$), 6);
    locate 26,70: print num$(val(secr$), 7);
wend
[/code]

Step 4: Alter the Boot Disk.

Picture of Alter the Boot Disk.

Edit the autoexec.bat file and add clock as the last line of the file.
Copy the clock.exe to the boot floppy.

c:\>copy clock.exe a:clock.exe

Step 5: Watch the Clock?

Picture of Watch the Clock?

Boot the laptop up with altered floppy you just made.

Step 6: Another Clock Program.

Picture of Another Clock Program.

You need to have experience with dos (and maybe a bit of French) to take advantage of this program. Wish I could have included the dos disk, but legally I could not. The clock.cab is a binary that expands into a ram disk. The autoexec.bat file has the details. Looked all over the place for this and finally found it.

Note: Forgot to set the system clock before starting the program.

{autoexec.bat]
@ECHO OFF
set EXPAND=YES
SET DIRCMD=/O:N
set LglDrv=27 * 26 Z 25 Y 24 X 23 W 22 V 21 U 20 T 19 S 18 R 17 Q 16 P 15
set LglDrv=%LglDrv% O 14 N 13 M 12 L 11 K 10 J 9 I 8 H 7 G 6 F 5 E 4 D 3 C
time
date
cls
call setramd.bat %LglDrv%
set temp=c:\
set tmp=c:\
path=%RAMD%:\
a:\
copy command.com %RAMD%:\ > NUL
set comspec=%RAMD%:\command.com
mode con codepage prepare=((850) ega.cpi)
mode con codepage select=850
keyb fr,,keyboard.sys
rem clean up environment variables
set CDROM=
set LglDrv=
a:\extract.exe /E a:\clock.cab /L %RAMD%:\
%RAMD%:\run.bat
[/autoexec.bat]

[config.sys]
files=10
buffers=10
stacks=9,256
Device=Himem.sys
Device=Emm386.exe NoEms
Dos=High,UMB
DeviceHigh=RamDrive.sys 32767 512 1024 /E
install=mode.com con cp prepare=((850) ega.cpi)
install=mode.com con cp select=850
rem install=keyb.com fr,,keyboard.sys
device=display.sys con=(ega,,1)
rem country=033,850,country.sys
[/config.sys]

Step 7: Binary Clock.

Picture of Binary Clock.

Just had to do a very simple binary clock version.....  One way to get kids into mathematics.  (fbc -lang qb binclock.bas)

binclock.bas
[code]
'=================================================================
' binary clock by computothought
'
'--------------------------------------------------------
'housekeeping
cls
true% = -1
locate 4,10 : print "The time is: "; time$;".";
locate 7,20: print "Hexadecimal";
locate 7,36: print "Binary";
'--------------------------------------------------------
Main loop
while true%

hr = val(left$(time$,2))  
min = val(mid$(time$,4,2))
sec = val(mid$(time$,7,2))      

'hours
locate 08,20: print "  ";
hr$ = right$("   " + hex$(hr),2)
locate 08,10: print "Hours";   : locate 08,20 : print hr$;
N=hr
gosub binit
bhr$ = C$
locate 08,30: print "                     ";
locate 08,30: print right$("                    " + bhr$,16);

'mins
locate 10,20: print "  ";
min$ = right$("   " + hex$(min),2)
locate 10,10: print "Minutes"; : locate 10,20 : print min$;
N=min
gosub binit
locate 10,30: print "                                 ";
bmin$ = C$
locate 10,30: print right$("                " + bmin$,16);

'secs
locate 12,20: print "  ";
sec$ = right$("   " + hex$(sec),2)
locate 12,10: print "Seconds"; : locate 12,20 : print sec$;
N=sec
gosub binit
locate 12,30: print "                                 ";
bsec$ = C$
locate 12,30: print right$("                  " + bsec$,16);

wend
'------------------------------------------------
' fake end
locate 14,1 : print;
end
'------------------------------------------------
'subroutines
binit:
C$=""
WHILE N <> 0
A = N MOD 2
B$ = STR$(A)
N = FIX(N / 2)
C$ = B$ + C$
WEND
return
[/code]

Step 8: Semi-analog Clock.

Picture of Semi-analog Clock.

Did not have time to do a true analog clock, so I made a semi-analog clock, (fbc -lang qb analogclock.bas)

analogclock.bas
[code]
'=================================================================
' semi-analog clock by computothought
'
'--------------------------------------------------------
'housekeeping
cls
true% = -1
locate 4,1: print "Hours";
locate 6,1: print "Minutes";
locate 8,1: print "Seconds";

locate 15,1: print "Hours";
locate 18,1: print "Minutes";
locate 21,1: print "Seconds";
'--------------------------------------------------------
'Main loop
while true%
locate 2,10 : print "The time is: "; time$;".";

hr = val(left$(time$,2))  
min = val(mid$(time$,4,2))
sec = val(mid$(time$,7,2))      

hr$ = right$("00" + str$(hr),2)
min$ = right$("00" + str$(min),2)
sec$ = right$("00" + str$(sec),2)

lhr$ = left$(hr$,1)
rhr$ = right$(hr$,1)
lmin$ = left$(min$,1)
rmin$ = right$(min$,1)
lsec$ = left$(sec$,1)
rsec$ = right$(sec$,1)

'hours
locate 5,1: print left$(string$(hr,"H") + string$(60, " "),60);
'mins
locate 7,1: print left$(string$(min,"M") + string$(60, " "),60);
'secs
locate 9,1: print left$(string$(sec,"S") + string$(60, " "),60);

'hours
if hr = 0 then locate 16,1: print string$(60, " ");
locate 16,1: print string$(hr - 1, " ");lhr$; string$(60 - hr, " ");
if hr = 0 then locate 17,1: print string$(60, " ");
locate 17,1: print string$(hr - 1, " ");rhr$; string$(60 - hr, " ");
'mins
if min = 0 then locate 19,1: print string$(60, " ");
locate 19,1: print string$(min - 1, " ");lmin$; string$(60 - hr, " ");
if min = 0 then locate 20,1: print string$(60, " ");
locate 20,1: print string$(min - 1, " ");rmin$; string$(60 - hr, " ");
'secs
if sec = 0 then locate 22,1: print string$(60, " ");
locate 22,1: print string$(sec - 1, " ");lsec$; string$(60 - hr, " ");
if sec = 0 then locate 23,1: print string$(60, " ");
locate 23,1: print string$(sec - 1, " ");rsec$; string$(60 - hr, " ");

wend
'------------------------------------------------
' fake end
locate 14,1 : print;
end
[/code]

Step 9: Analog Clock in Progress.

Picture of Analog Clock in Progress.
Our goal is to work on an old laptop. That mean graphics are out of the question and you only have 4k of ram to hold the operating system and your program. If I use assembly language, I probably could of done something with graphics, but my time is limited.

www.delorie.com/djgpp/compile/

aclock_dos.c: (use at your own risk)
[code]
/*
 * aclock - ascii clock for MS-DOS Text Mode
 *
 * Copyright (c) 2002-2004 Antoni Sawicki <tenox@tenox.tc>
 * Version 1.9 (msdos-watcom); Dublin, July 2004
 *
 * Compilation: Open Watcom 1.2
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <graph.h>
#include <math.h>

#define PI           3.14159265358979323846


void draw_point(int x, int y, char p){
        char string[2];
       
        string[0]=p;
        string[1]=0;

        _settextposition(y, x);
        _outtext(string);
}

void draw_circle(int hand_max, int sXcen, int sYcen, int FontHW){
        double x,y;
        int r;
        char c;

 
        for(r=0;r<60;r++){
                x=cos(r*PI/180*6)*hand_max*FontHW+sXcen;
                y=sin(r*PI/180*6)*hand_max+sYcen;
                switch (r) {
                        case 0:
                        case 5:
                        case 10:
                        case 15:
                        case 20:
                        case 25:
                        case 30:
                        case 35:
                        case 40:
                        case 45:
                        case 50:
                        case 55:
                                c='o';
                                break;
                        default:
                                c='.';
                                break;
                }
                draw_point(x,y,c);
        }
       
}


void draw_hand(int minute, int hlenght, char c, int sXcen, int sYcen, int FontHW){
        double x,y;
        int n;
        float r=(minute-15)*(PI/180)*6;

        for(n=1; n<hlenght; n++){
                x=(cos(r)*n*FontHW)+sXcen;
                y=(sin(r)*n)+sYcen;
                draw_point(x,y,c);
        }
}


void draw_text(char *p, int x, int y){
        _settextposition(y, x);
        _outtext(p);
}



int main(void) {
        char info[]="Written by Antoni Sawicki <tenox@tenox.tc>\nVersion 1.9; Dublin, Mar 2004\n";
        char digital_time[15];
        short FontHW = 2;
        short sXmax, sYmax, smax, hand_max, sXcen, sYcen;
        time_t t;
        struct tm *ltime;
        short unused;
        double test;

        

        for(;;){
                time(&t);
                ltime=localtime(&t);
                _gettextwindow( &unused, &unused, &sYmax, &sXmax );


                if(sXmax++/2<=sYmax++)
                        smax=sXmax/2;
                else
                        smax=sYmax;

                hand_max = (smax/2)-1;

                sXcen = sXmax/2;
                sYcen = sYmax/2;

                _clearscreen(_GCLEARSCREEN);

                draw_hand(ltime->tm_hour*5+ltime->tm_min/10, 2*hand_max/3, 'h', sXcen, sYcen, FontHW);
                draw_hand(ltime->tm_min, hand_max-2, 'm', sXcen, sYcen, FontHW);
                draw_hand(ltime->tm_sec, hand_max-1, '.', sXcen, sYcen, FontHW);

                draw_circle(hand_max, sXcen, sYcen, FontHW);
                draw_text(".:ACLOCK:.", sXcen-5, sYcen/3);

                sprintf(digital_time, "[%02d:%02d:%02d]", ltime->tm_hour, ltime->tm_min, ltime->tm_sec);
                draw_text(digital_time, sXcen-5, 4*sYmax/5);

                sleep(1);
        }
        
    return 0;
}
[/code]

Comments

msansores (author)2014-01-01

You are sick! Amazing work!!

Computothought (author)msansores2014-01-10

Thanks for the amazing work part.

sunshiine (author)2011-09-03

Very nice ible but I know I could not do this! I am sure there are a ton of people here that could! You tweeked this very nicely!

Computothought (author)sunshiine2011-09-04

Thanx. I actually did not like the other program not written by me, but it was all I could find. There are people that do. Then I decided to make my own more conventional and simpler clock. Still need to do a bit of tweaking though.

About This Instructable

5,026views

11favorites

License:

Bio: computoman.blogspot.com Bytesize articles instead of a trilogy in one post.
More by Computothought:Coffeepot mealsEasy sun hatEasy cakes and pies.
Add instructable to: