CmdClock

From MCS Wiki AVR
(Difference between revisions)
Jump to: navigation, search
(Created page with "= <span style="font-size: 14pt; font-weight: bold;">Action</span> = Draw a Analog Clock. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;">&...")
 
 
Line 135: Line 135:
 
' A clock with radius 50 pixels, showing a time of 8.15
 
' A clock with radius 50 pixels, showing a time of 8.15
 
CmdClock 80, 60, 50, 0, 8, 15, 0, 0
 
CmdClock 80, 60, 50, 0, 8, 15, 0, 0
</source> PIC24 <source lang="bascomavr">
+
</source> [[File:Clip0024.png|center|Clip0024.png]] <source lang="bascomavr">
 
' Setting the background color  
 
' Setting the background color  
 
CmdBgColor &H401010
 
CmdBgColor &H401010
 
CmdClock 80, 60, 50, 0, 8, 15, 0, 0
 
CmdClock 80, 60, 50, 0, 8, 15, 0, 0
</source> PIC25 <source lang="bascomavr">
+
</source> [[File:Clip0025.png|center|Clip0025.png]] <source lang="bascomavr">
 
' Without the 3D look
 
' Without the 3D look
 
CmdClock 80, 60, 50, OPT_FLAT, 8, 15, 0, 0
 
CmdClock 80, 60, 50, OPT_FLAT, 8, 15, 0, 0
Line 147: Line 147:
 
   
 
   
 
CmdClock 80, 60, 50, 0, 0, 0, (7 * 3600) + (38 * 60) + 59, 0
 
CmdClock 80, 60, 50, 0, 0, 0, (7 * 3600) + (38 * 60) + 59, 0
</source> PIC26 <source lang="bascomavr">
+
</source> [[File:Clip0026.png|center|Clip0026.png]] <source lang="bascomavr">
 
' No seconds hand
 
' No seconds hand
 
CmdClock 80, 60, 50, OPT_NOBACK, 8, 15, 0, 0
 
CmdClock 80, 60, 50, OPT_NOBACK, 8, 15, 0, 0
</source> PIC27 <source lang="bascomavr">
+
</source> [[File:Clip0027.png|center|Clip0027.png]] <source lang="bascomavr">
 
' No background
 
' No background
 
CmdClock 80, 60, 50, OPT_NOBACK, 8, 15, 0, 0
 
CmdClock 80, 60, 50, OPT_NOBACK, 8, 15, 0, 0
</source> PIC28 <source lang="bascomavr">
+
</source> [[File:Clip0028.png|center|Clip0028.png]] <source lang="bascomavr">
 
' No Ticks
 
' No Ticks
 
CmdClock 80, 60, 50, OPT_NOTICKS, 8, 15, 0, 0
 
CmdClock 80, 60, 50, OPT_NOTICKS, 8, 15, 0, 0
</source> PIC29 <source lang="bascomavr">
+
</source> [[File:Clip0029.png|center|Clip0029.png]] <source lang="bascomavr">
 
' No Hands
 
' No Hands
 
CmdClock 80, 60, 50, OPT_NOHANDS, 8, 15, 0, 0
 
CmdClock 80, 60, 50, OPT_NOHANDS, 8, 15, 0, 0
</source> PIC30
+
</source> [[File:Clip0030.png|center|Clip0030.png]]
  
 
{{Languages}}
 
{{Languages}}
  
 
[[Category:FT800 Commands]]
 
[[Category:FT800 Commands]]

Latest revision as of 14:41, 12 December 2014

Contents

Action

Draw a Analog Clock.

 

 

Syntax

CmdClock x, y, r, options, h, m, s, ms

 

 

Remarks

x

x-coordinate of clock center, in pixels

y

y-coordinate of clock center, in pixels

r

Radius of the gauge, in pixels

options

By default the clock dial is drawn with a 3D effect and the name of this option is OPT_3D.

Option OPT_FLAT removes the 3D effect.

With option OPT_NOBACK, the background is not drawn.

With option OPT_NOTICKS, the twelve hour ticks are not drawn.

With option OPT_NOSECS, the seconds hand is not drawn.

With option OPT_NOHANDS, no  hands  are  drawn.

With option OPT_NOHM, no hour and minutes hands are drawn.

h

hours

m

minutes

s

seconds

ms

milliseconds

 

The details of physical dimension are:

The 12 tick marks are placed on a circle of radius r*(200/256).
Each tick is a point of radius r*(10/256)
The seconds hand has length r*(200/256) and width r*(3/256)
The minutes hand has length r*(150/256) and width r*(9/256)
The hours hand has length r*(100/256) and width r*(12/256)

 

Refer to sections 5.7 Widgets physical dimensions and 5.7 Widget color settings in the FT800 Series Programmer Guide.PDF from FTDI

for more information.

 

Example

' A clock with radius 50 pixels, showing a time of 8.15
CmdClock 80, 60, 50, 0, 8, 15, 0, 0
Clip0024.png
' Setting the background color 

CmdBgColor &H401010

CmdClock 80, 60, 50, 0, 8, 15, 0, 0
Clip0025.png
' Without the 3D look

CmdClock 80, 60, 50, OPT_FLAT, 8, 15, 0, 0   ' The time fields can have large values. Here the hours are (7 x 3600s) and minutes ' are (38 x 60s), and seconds is 59. Creating a clock face showing the time as 7.38.59  

CmdClock 80, 60, 50, 0, 0, 0, (7 * 3600) + (38 * 60) + 59, 0
Clip0026.png
' No seconds hand
CmdClock 80, 60, 50, OPT_NOBACK, 8, 15, 0, 0
Clip0027.png
' No background
CmdClock 80, 60, 50, OPT_NOBACK, 8, 15, 0, 0
Clip0028.png
' No Ticks
CmdClock 80, 60, 50, OPT_NOTICKS, 8, 15, 0, 0
Clip0029.png
' No Hands
CmdClock 80, 60, 50, OPT_NOHANDS, 8, 15, 0, 0
Clip0030.png
Languages   English  
Personal tools
Namespaces
Variants
Actions
Navigation
Language