Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 12:24 02 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : matherp bigben clock prob - and others

Author Message
oldtimer
Newbie

Joined: 02/12/2016
Location: Australia
Posts: 18
Posted: 08:38pm 11 Apr 2017
Copy link to clipboard 
Print this post

Hi All
I wonder if anyone can suggest a solution to the following - Some weeks ago I successfully got the bigben clock running on an explore 100 and ssd 1963 screen using matherps code and the 100 pin cfunction attachment - it adorned my office computer and kept correct time -without a problem- I was even brave enough to experiment with different clock faces downloaded ,reduced in size to fit the 480 by 480 pixel size of the display and converted to BMP files

I was absent from my home for some weeks and the setup sat idle for that time- upon return - having made sure I had the clock code safely stored away - I used the explore 100/ tft display for another purpose - the oil pressure gauge with the blit command operating the pointer - some days later I reinstalled the bigben code - and now find the hour hand behaving in a strange fashion- when the code is first run the time is displayed correctly (with the RTC installed)until the second and minute hand reach the 12 o,clock position at which time the hour hand flicks back to the last hour position- I have removed the RTC thinking the internal clock may be faulty but on running the code without the RTC - the hands all immediately go to the 12 o,clock position indicating the normal internal clock default - 00:00:00 - 1 JAN 2000

about 1 second later the hour hand jumps to the 1 o,clock position , the second and minute hand behaving normally- 1 hour later - with the minute and second hand at the 12 o,clock position - the hour hand jumps back to the 12 o,clock position - this cycle repeats itself endlessly

I have printed the internal clock time when the display shows the hour hand in the incorrect position and the time returned as a string is correct - meaning the clock hands are not reading the internal - or the RTC when fitted, correctly

the hour hand can be forced to read correctly - for 1 hour anyway - by leaving teraterm connected and when the hour hand flicks back to the last hour - re running the code using F2 - this then displays the hand in the correct position - for 1 hour at least

I was wondering if anyone could suggest a solution to this weird problem

on another subject - is it possible to remove individual OPTIONS if one wishes to remove items in the OPTION list - or is it necessary to use OPTION RESET and then rewrite all the required options again- and another - is it possible to draw a line using the LINE command, pause it for say 900ms, then erase that line and redraw it in another position - as in the second hand of the super clock- all against the background of a nominated colour so as to appear like a revolving second hand

Ive tried using the LINE command and the CLS RGB but the time taken to redraw the line after clearing the screen to a colour and then redrawing the line makes the display appear very "flickery" - as its obviously possible to achieve - would anyone be able to provide the code snippet for that function

many thanks

oldtimer
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 09:09pm 11 Apr 2017
Copy link to clipboard 
Print this post

  oldtimer said   is it possible to remove individual OPTIONS if one wishes to remove items in the OPTION list - or is it necessary to use OPTION RESET and then rewrite all the required options again

Yes - you can remove individual OPTIONS (or directly change them in some cases)

OPTION .... DISABLE will delete certain OPTIONS such as LCDPANEL SDCARD, RTC etc
You will need to DISABLE them rather than just change them using 'new parameters'. For example, if you set up the TFT but incorrectly type a pin number, th OPTION will be saved with whatever you typed in (i.e. the wrong pin number). To change to the correct pin number, you will need to DISABLE the OPTION first (to remove it from the list), and then re-enter the correct/new parameters.

Some OPTIONS are changeable directly i.e. on the MMX, OPTION HEARTBEAT can be switched between ON and OFF (i.e. without the need to DISABLE first)

Hope this makes sense

WW

For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 09:12pm 11 Apr 2017
Copy link to clipboard 
Print this post

  oldtimer said  is it possible to draw a line using the LINE command, pause it for say 900ms, then erase that line and redraw it in another position - as in the second hand of the super clock- all against the background of a nominated colour so as to appear like a revolving second hand

Ive tried using the LINE command and the CLS RGB but the time taken to redraw the line after clearing the screen to a colour and then redrawing the line makes the display appear very "flickery" - as its obviously possible to achieve - would anyone be able to provide the code snippet for that function


One trick is to simply draw the line in the background colour to effectively erase the line - much quicker than a CLS
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
oldtimer
Newbie

Joined: 02/12/2016
Location: Australia
Posts: 18
Posted: 03:01pm 15 Apr 2017
Copy link to clipboard 
Print this post

WW - option disable command working fine - many thanks - still playing with erasing single line at 1000ms intervals to display sweep second hand - again thanks

oldtimer
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5909
Posted: 05:55pm 15 Apr 2017
Copy link to clipboard 
Print this post

Not sure which code you are using.
This is one analogue clock program I played with a while ago

' clockface.bas
' Font type : Full (1 characters)
' Font size : 240x240 pixels
' Memory usage : 7204 bytes
' Font adapted from: http://www.rinkydinkelectronics.com/r_fonts.php
Hl = 55 ' length of hands
Ml = 70
Sl = 80
Xs = MM.HRES/2 ' "old" hands position
Ys = MM.VRES/2
Xm = MM.HRES/2
Ym = MM.VRES/2
Xh = MM.HRES/2
Yh = MM.VRES/2
CLS
SETPIN 26,DOUT ' display brightness
PIN(26)=1
TEXT MM.HRES/2,MM.VRES/2, " ",CM,8,1,RGB(YELLOW) 'draw the clock face
SETTICK 1000,ticktock
DO
LOOP

SUB ticktock
timeNow$ = TIME$
sec = VAL(MID$(timeNow$,7,2))
min = VAL(MID$(timeNow$,4,2))
min = min+sec/60
hr = VAL(MID$(timeNow$,1,2))
IF hr >=12 THEN hr = hr-12 ' convert to 12 hour
hr = hr+min/60

LINE MM.HRES/2, MM.VRES/2,Xh,Yh,1,RGB(BLACK)' erase the old hands
LINE MM.HRES/2, MM.VRES/2,Xm,Ym,1,RGB(BLACK)
LINE MM.HRES/2, MM.VRES/2,Xs,Ys,1,RGB(BLACK)

Sa = RAD(360*sec/60)+PI ' seconds
Xs = MM.HRES/2-Sl*SIN(Sa)
Ys = MM.VRES/2+Sl*COS(Sa)

Ma = RAD(360*min/60)+PI ' minutes
Xm = MM.HRES/2-Ml*SIN(Ma)
Ym = MM.VRES/2+Ml*COS(Ma)

Ha = RAD(360*hr/12)+PI ' hours
Xh = MM.HRES/2-Hl*SIN(Ha)
Yh = MM.VRES/2+Hl*COS(Ha)

LINE MM.HRES/2, MM.VRES/2,Xh,Yh,1,RGB(WHITE) ' draw the new hands
LINE MM.HRES/2, MM.VRES/2,Xm,Ym,1,RGB(WHITE)
LINE MM.HRES/2, MM.VRES/2,Xs,Ys,1,RGB(CYAN)

END SUB


DEFINEFONT #8
0120F0F0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
FF000000 80FFFF8F 00000000 00000000 00000000 00000000 00000000 00000000
9F033E00 0000003E 00000000 00000000 00000000 00000000 00000000 3E000000
003E1E02 00000000 00000000 00000000 00000000 00000000 00000000 1E061F00
0000003E 00000000 00000000 00000000 00000000 00000000 1F000000 003E1E84
00000000 00000000 00000000 00000000 00000000 00000000 1E8C0F00 0000003E
00000000 00000000 00000000 00000000 00000000 07000000 003E1ED8 00000000
00000000 00000000 00000000 00000000 00000000 1ED80700 0000003E 00000000
00000000 00000000 00000000 00000000 03000000 003E1EE0 00000000 00000000
00000000 00000000 00000000 0000C000 1EE00300 0000003E 00000000 00000000
00000000 00000000 80030000 03000000 003E1EF0 00000000 00000000 00000000
00000000 00000000 0000C007 1EF80100 0000003E 00000000 00000000 00000000
00000000 E01F0000 01000000 003E1EF8 00000000 00000000 00000000 00000000
00000000 0000E073 1E7C0100 0000003E 00000200 00000000 00000000 00000000
F0E30100 02000000 003E1E7C 03000000 00000080 00000000 00000000 01000000
0000F0E1 1E7E0200 0000003E 00C00300 00000000 00000000 00000000 F8210000
04000000 003E1E3E 03000000 000000F0 00000000 00000000 30000000 0000FC20
1E1F0800 0000003E 00FC0300 00000000 00000000 00000000 FC20E000 18000000
003E9E1F 07000000 000000C0 00000000 00000000 F0010000 00007C20 9E0F1000
0000003E 00C00700 00000000 00000000 00000000 3E20FC07 38000000 003EFF1F
0F000000 00000080 00000000 00000000 FF030000 00001F60 FF1FFE01 000080FF
00800F00 00000000 00000000 00000000 1F20FF00 00000000 00000000 1F000000
00000000 00000000 00000000 3F000000 00801FC0 00000000 00000000 00003F00
00000000 00000000 00000000 0FF01F00 00000080 00000000 3E000000 00000000
00000000 00000000 07000000 00C007FC 00000000 00000000 00007C00 00000000
00000000 00000000 07FF0100 000000E0 00000000 7C000000 00000000 00000000
00000000 00000000 00F883FF 00000000 00000000 0000F800 00000000 00000000
00000000 E1DF0000 000000E0 00000000 F8000000 00000000 00000000 00000000
00000000 0080F9CF 00000000 00000000 0000F001 00000000 00000000 00000000
FFC70000 00000000 00000000 F0030000 00000000 00000000 00000000 00000000
0000FCC1 00000000 00000000 0000E013 00000000 00000000 00000000 F8C00000
00000000 00000000 C01F0000 00000000 00000000 00000000 00000000 0000C0C0
00000000 00000000 00008003 00000000 00000000 00000000 80C10000 00000000
00000000 C0010000 00000000 00000000 00000000 00000000 00000080 00000000
00000000 00004000 00000000 00000000 00000000 00F00000 00000000 00000000
20000000 00000000 00000000 00000000 00000000 000000E0 00000000 00000000
00000000 00000000 00000000 00000000 00C00100 00000000 00000000 00000000
00000000 00000000 00000000 01000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 C0000000 00000000 00000000 00000000
00000000 00000000 00010000 00000000 0000E000 00000000 00000000 00000000
00000000 00000000 00008007 E0010000 00000000 00000000 00000000 00000000
00000000 C00F0000 00000000 00006001 00000000 00000000 00000000 00000000
00000000 0000C03F 30000000 00000000 00000000 00000000 00000000 00000000
E0FF0000 00000000 00001000 00000000 00000000 00000000 00000000 03000000
000010FF 18000000 00000000 00000000 00000000 00000000 00000000 30F80F00
00000000 00000800 00000000 00000000 00000000 00000000 1F000000 000078F8
08080000 00000000 00000000 00000000 00000000 00000000 F8E07F00 00000000
F8FFFD1D 00000000 00000000 00000000 00000000 FF0E0000 0000FC07 FF1F0000
0000F0FF 00000000 00000000 00000000 00000000 F41FFE07 00000000 F0FFFF1F
00000000 00000000 00000000 00000000 F8070000 0000F23F FF3F0000 0000E0FF
00000000 00000000 00000000 00000000 80FFE003 00000000 E0FFFF7F 00000000
00000000 00000000 00000000 83010000 000000FF 01400000 0000C000 00000000
00000000 00000000 00000000 00F88F01 00000000 80800100 00000000 00000000
00000000 00000000 9F000000 000000F0 00000000 00000080 00000000 00000000
00000000 00000000 00E0FF00 00000000 00C00000 00000000 00000000 00000000
00000000 7F000000 00000000 00000000 00000060 00000000 00000000 00000000
00000000 00007C00 00000000 00600000 00000000 00000000 00000000 00000000
38000000 00000000 00000000 00000026 00000000 00000000 00000000 00000000
00001000 00000000 003C0000 00000000 00000000 00000000 00000000 10000000
00000000 00000000 00000018 00000000 00000000 00000000 00000000 00000800
00000000 00180000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000010 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 04000000 00000000 00000000 00000000
00000000 00000000 00000000 80000000 00000C00 00000000 00000000 00000000
00000000 00000000 00000000 1C008000 00000000 00000000 00000000 00000000
00000000 00080000 C0000000 00007C00 00000000 00000000 00000000 00000000
00000000 40000008 FC01F000 00000000 00000000 00000000 00000000 00000000
FF0F0000 9800C0FF 0000FC07 00000000 00000000 00000000 00000000 00000000
C0FFFF0F FC0F8C00 00000000 00000000 00000000 00000000 00000000 FF0F0000
0300C0FF 0000EC3F 00000000 00000000 00000000 00000000 00000000 C0FFFF0F
C4FF0000 00000000 00000000 00000000 00000000 00000000 FF0D0000 0300C0FE
000000FE 00000000 00000000 00000000 00000000 00000000 40000008 00F80700
00000000 00000000 00000000 00000000 00000000 00080000 9F004000 000000FC
00000000 00000000 00000000 00000000 00000000 C000000C 04C6FF00 00000000
00000000 00000000 00000000 00000000 FF0F0000 FF00C0FF 00008C01 00000000
00000000 00000000 00000000 00000000 C0FFFF0F C400FE00 00000000 00000000
00000000 00000000 00000000 FF0F0000 F800C0FF 00007C00 00000000 00000000
00000000 00000000 00000000 C0FFFF0F 1C00E000 00000000 00000000 00000000
00000000 00000000 00080000 8000C000 00000C00 00000000 00000000 00000000
00000000 00000000 40000008 04008000 00000000 00000000 00000000 00000000
00000000 00080000 FF004000 0000FCFF 00000000 00000000 00000000 00000000
00000000 C0FFFF0E FCFFFF00 00000000 00000000 00000000 00000000 00000000
FF0F0000 FF00C0FF 0000FCFF 00000000 00000000 00000000 00000000 00000000
C0FFFF0F FCFFFF00 00000000 00000000 00000000 00000000 00000000 FF0F0000
FF00C0FF 0000FCFF 00000000 00000000 00000000 00000000 00000000 C0FFFF0F
0C008000 00000000 00000000 00000000 00000000 00000000 00080000 00014000
00000400 00000000 00000000 00000000 00000000 00000000 00000000 04000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00800000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000080 00000000 00000000 00000000 00000000 00000000 00000000 00C00000
00000000 00000000 00000000 00000000 00000000 00000000 01000000 000000C0
00000000 00000000 00000000 00000000 00000000 00000000 00E00700 00000000
00000000 00000000 00000000 00000000 00000000 0F000000 000000E0 00000000
00000000 00000000 00000000 00000000 00000000 00F07F00 00000000 00000000
00000000 00000000 01000000 00000000 FF010000 00000090 00000000 00000000
00000000 00000000 00000300 00000000 0018FE03 00000000 00000000 00000000
00000000 06000000 00000000 FC0F0000 00000018 00000000 00000000 00000000
00000000 00800700 04000000 007CE07F 00000000 00000000 00000000 00000000
0F000000 000000E0 81FF0700 000000FE 00000000 00000000 00000000 00000000
00F00F00 03000000 00FE03FE 00000000 00000000 00000000 00000000 1F000000
000000FC 0FFC0100 000000FA 00000000 00000000 00000000 00000000 00FE3300
01000000 00E17FF0 00000000 00000000 00000000 00000000 30000000 000080FF
FFC10000 00000081 00000000 00000000 00000000 00000000 E03F7800 00000000
8003FF83 00000000 00000000 00000000 00000000 7E000000 0000F80F FC4F0000
0000800F 00000000 00000000 00000000 00000000 FC07FF00 00000040 C07FF07F
00000000 00000000 00000000 00000000 BF000000 0080FFE1 C13F0000 0000E0FF
00000000 00000000 00000000 00000000 7FF01F01 00000080 C0FF033F 00000000
00000000 00000000 00000000 0F010000 00003FF8 0F1C0000 000000FC 00000000
00000000 00000000 00000000 0FFE8303 00000000 00F07F18 00000000 00000000
00000000 00000000 E0070000 000086FF FF090000 000000C0 00000000 00000000
00000000 00000000 E43FF007 00000000 0000FF0D 00000000 00000000 00000000
00000000 F80F0000 0000FC1F FC070000 00000000 00000000 00000000 00000000
00000000 F807FE1B 00000000 0000F007 00000000 00000000 00000000 00000000
FF300000 0000F081 C0030000 00000E00 00000000 00000000 00000000 00000000
70E03F38 00000000 FE010003 00000000 00000000 00000000 00000000 1F3E0000
000060F0 0F010000 0000FCFF 00000000 00000000 00000000 00000000 60FC077F
00000000 F801FF01 00000000 00000000 00000000 00000000 E1FF0000 000040FF
C0000000 0000F003 00000000 00000000 00000000 00000000 807FF09F 00000000
E0078000 00000000 00000000 00000000 00000000 F80F0000 0000803F 40000000
0000C00F 00000000 00000000 00000000 00000000 000FFE03 00000000 801F0000
00000000 00000000 00000000 00000000 FF000000 00000087 00000000 0000003F
00000000 00000000 00000000 00000000 00E23F00 00000000 007E0000 00000000
00000000 00000000 00000000 1F000000 000000F6 00000000 000000FC 00000000
00000000 00000000 00000000 00FC0700 00000000 00F80100 00000000 00000000
00000000 00000000 01000000 000000F8 0B000000 000000F0 00000000 00000000
00000000 00000000 00700000 00000000 00F00F00 00000000 00000000 00000000
00000000 00000000 00000030 07000000 000000E0 00000000 00000000 00000000
00000000 00300000 00000000 00C00700 00000000 00000000 00000000 00000000
00000000 00000000 03000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000300 00000000 00000000 00000000 00000000 00000000
00000000 00000000 01000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00E00000 00000000 00000000 00000000 00000000 00000000
00000000 01000000 000000F0 00000000 00000000 00000000 00000000 00000000
00000000 00F80100 00000000 00000000 00000000 00000000 00000000 00000000
03000000 000000E6 00000000 00000000 00000000 00000000 00000000 00000000
00E30300 00000000 00000000 00000000 00000000 00000000 00000000 07000000
0000C0C3 00000000 00000000 00000000 00000000 00000000 00000000 E0C70F00
00000000 00000000 00040000 00000000 00000000 00000000 0F000000 0000C88F
00000000 00000000 00000006 00000000 00000000 00000000 800F1F00 00000000
00000000 00070000 00000000 00000000 00000000 3F000000 0000001F 00000000
00000000 0000C003 00000000 00000000 00000000 001F3E00 00000000 00000000
C0070000 00000000 00000000 00000000 3E000000 0020003E 00000000 00000000
0000F007 00000000 00000000 00000000 003EFC00 000000E0 00000000 F8030000
00000000 00000000 00000000 FC000000 00E001FC 00000000 00000000 0000FC02
00000000 00000000 00000000 03FCF800 000000C0 00000000 7F030000 00000000
00000000 00000000 F1010000 00E00FF8 00000000 00000000 00803F03 00000000
00000000 00000000 1BF0E113 000000C0 00000000 0F030000 000000C0 00000000
00000000 E30F0000 00C033F0 00000000 00000000 00F00F03 00000000 00000000
00000000 67E0E307 070000C0 000000F8 07010000 000000F0 00000000 00000000
C7010000 00C087C1 0CF00300 00000000 00FC0101 00000000 00000000 00000000
03C36F00 030000C0 00001CE0 80010000 000000FF 00000000 00000000 3F000000
00C007CE 1EE00300 00000000 007E8000 00000000 00000000 00000000 078C1F00
03000080 00001CE0 80000000 00000038 00000000 00000000 07000000 00800F30
3EE00300 00000000 00308000 00000000 00000000 00000000 0FE00100 03000080
00003EE0 80000000 00000040 00000000 00000000 00000000 00000FE0 3FE00300
00000000 0000C000 00000000 00000000 00000000 0F300000 03000000 00006FE0
C0000000 00000000 00000000 00000000 00000000 00001F00 4FE00300 00000080
0000F800 00000000 00000000 00000000 0E000000 03000000 00804FE0 60000000
00000000 00000000 00000000 00000000 00001F00 C7E00300 000000C0 00008000
00000000 00000000 00000000 7F000000 03000000 008087E0 00000000 00000000
00000000 00000000 00000000 00001E00 87E10300 000000C0 00000000 00000000
00000000 00000000 06000000 03000000 00C083E1 00000000 00000000 00000000
00000000 00000000 00000200 03E10300 000000E0 00000000 00000000 00000000
00000000 00000000 03000000 00E003E3 00000000 00000000 00000000 00000000
00000000 00000000 01E20300 000000E0 00000000 00000000 00000000 00000000
00000000 03000000 00F001E2 00000000 00000000 00000000 00000000 00000000
00000000 01E60300 000000F0 00000000 00000000 00000000 00000000 00000000
01000000 00F800E4 00000000 00000000 00000000 00000000 00000000 00000000
83FF0700 000000FC 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
END DEFINEFONT

You need to keep the code between when you draw over the old hand to when you draw the new hands as short as possible to reduce flicker.
If you precalculated the new positions and saved the results for old and new before drawing over the old ones, there would be less flicker but I am happy with the above code as it is.

Jim
VK7JH
MMedit   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5909
Posted: 06:24pm 15 Apr 2017
Copy link to clipboard 
Print this post

This sub precalculates the new positions.
Visually, there is little difference.
  Quote  SUB ticktock
timeNow$ =
TIME$
sec =
VAL(MID$(timeNow$,7,2))
min =
VAL(MID$(timeNow$,4,2))
min = min+sec/
60
hr =
VAL(MID$(timeNow$,1,2))
IF hr >=12 THEN hr = hr-12 ' convert to 12 hour
hr = hr+min/60
XhO = Xh
YhO = Yh
XmO = Xm
YmO = Ym
XsO = Xs
YsO = Ys

Sa =
RAD(360*sec/60)+PI ' seconds
Xs = MM.HRES/2-Sl*SIN(Sa)
Ys =
MM.VRES/2+Sl*COS(Sa)

Ma =
RAD(360*min/60)+PI ' minutes
Xm = MM.HRES/2-Ml*SIN(Ma)
Ym =
MM.VRES/2+Ml*COS(Ma)

Ha =
RAD(360*hr/12)+PI ' hours
Xh = MM.HRES/2-Hl*SIN(Ha)
Yh =
MM.VRES/2+Hl*COS(Ha)

LINE MM.HRES/2, MM.VRES/2,XhO,YhO,1,RGB(BLACK)' erase the old hands
LINE MM.HRES/2, MM.VRES/2,XmO,YmO,1,RGB(BLACK)
LINE MM.HRES/2, MM.VRES/2,XsO,YsO),1,RGB(BLACK)

LINE MM.HRES/2, MM.VRES/2,Xh,Yh,1,RGB(WHITE) ' draw the new hands
LINE MM.HRES/2, MM.VRES/2,Xm,Ym,1,RGB(WHITE)
LINE MM.HRES/2, MM.VRES/2,Xs,Ys,1,RGB(CYAN)

END SUB



VK7JH
MMedit   MMBasic Help
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024