Jump to content

wrist watch LCD display GUI


MRI123
 Share

Recommended Posts

What would be the easiest way to code a wrist watch LCD display GUI?

For example a simple watch with 4 seven segments with a 24h(23:59) clock functions.

I´ve done some simple things with paint and SplashImageOn combination. Any other ideas...?

Thanks in advance!

Link to comment
Share on other sites

What would be the easiest way to code a wrist watch LCD display GUI?

For example a simple watch with 4 seven segments with a 24h(23:59) clock functions.

I´ve done some simple things with paint and SplashImageOn combination. Any other ideas...?

Thanks in advance!

I would expect the simplest way would be to find a free 7 segment font rather than create your own characters. Then all you need is a label and just set the text to the time.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Following martins advice, there are two 7-segment fonts in this file

http://www.twyman.org.uk/Fonts/7-Segment-Fonts.zip

3D and plain

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Thanks for the idea and font link!

P.S. How to add blinking semicolon between hour, min and sec...? (Again - the easiest way...)

P.P.S Copy font files => C:\WINDOWS\Fonts

;*****************************************************************************************************
;*****************************************************************************************************

HotKeySet("^!x", "MyExit") ;CRTL+ALT+x

Func MyExit()

    MsgBox(0, "7 Segment clock", "Closing...", 1)

    Exit
EndFunc

;*****************************************************************************************************
;*****************************************************************************************************


;*****************************************************************************************************

Opt("TrayIconDebug", 1)

;*****************************************************************************************************


#include <GUIConstants.au3>
#include <string.au3>


$Form1 = GUICreate("7 Segment clock", 170, 70, 100, 100)

$HOUR = GUICtrlCreateLabel("12", 10, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")
$MIN = GUICtrlCreateLabel("12", 60, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")
$SEC = GUICtrlCreateLabel("12", 110, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")

GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg

Case $GUI_EVENT_CLOSE
Exit
case Else

GUICtrlSetData($HOUR,@HOUR)
GUICtrlSetData($MIN,@MIN)
GUICtrlSetData($SEC,@SEC)
Sleep(1000)

EndSwitch
WEnd
Edited by MRI123
Link to comment
Share on other sites

Thanks for the idea and font link!

P.S. How to add blinking semicolon between hour, min and sec...? (Again - the easiest way...)

P.P.S Copy font files => C:\WINDOWS\Fonts

;*****************************************************************************************************
;*****************************************************************************************************

HotKeySet("^!x", "MyExit") ;CRTL+ALT+x

Func MyExit()

    MsgBox(0, "7 Segment clock", "Closing...", 1)

    Exit
EndFunc

;*****************************************************************************************************
;*****************************************************************************************************


;*****************************************************************************************************

Opt("TrayIconDebug", 1)

;*****************************************************************************************************


#include <GUIConstants.au3>
#include <string.au3>


$Form1 = GUICreate("7 Segment clock", 170, 70, 100, 100)

$HOUR = GUICtrlCreateLabel("12", 10, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")
$MIN = GUICtrlCreateLabel("12", 60, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")
$SEC = GUICtrlCreateLabel("12", 110, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")

GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg

Case $GUI_EVENT_CLOSE
Exit
case Else

GUICtrlSetData($HOUR,@HOUR)
GUICtrlSetData($MIN,@MIN)
GUICtrlSetData($SEC,@SEC)
Sleep(1000)

EndSwitch
WEnd

Something like this perhaps

;*****************************************************************************************************
;*****************************************************************************************************

HotKeySet("^!x", "MyExit") ;CRTL+ALT+x

Func MyExit()

    MsgBox(0, "7 Segment clock", "Closing...", 1)

    Exit
EndFunc ;==>MyExit

;*****************************************************************************************************
;*****************************************************************************************************


;*****************************************************************************************************

Opt("TrayIconDebug", 1)

;*****************************************************************************************************


#include <GUIConstants.au3>
#include <string.au3>


$Form1 = GUICreate("7 Segment clock", 200, 70, 100, 100)

$HOUR = GUICtrlCreateLabel("12", 10, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")

$c1 = GUICtrlCreateLabel(":", 60, 3, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "Arial")

$MIN = GUICtrlCreateLabel("12", 70, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")

$C2 = GUICtrlCreateLabel(":", 120, 3, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "Arial")

$SEC = GUICtrlCreateLabel("12", 130, 10, 50, 50)
GUICtrlSetFont(-1, 36, 800, 0, "7 Segment")

GUISetState(@SW_SHOW)
AdlibEnable("updateClock", 1000)

Global $colon = $GUI_HIDE

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

    Case $GUI_EVENT_CLOSE
    Exit

    EndSwitch
WEnd


Func updateClock()
    Local $s, $m
    $colon = $GUI_HIDE + $GUI_SHOW - $colon
    $s = @SEC
    $m = @MIN
    GUICtrlSetData($SEC, $s)
    If $s = 0 Then GUICtrlSetData($MIN, @MIN)

    If $m = 0 Then GUICtrlSetData($HOUR, @HOUR)

    GUICtrlSetState($C1, $colon)
    GUICtrlSetState($C2, $colon)

EndFunc ;==>updateClock
Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Moderators

MRI123,

If you want a graphical solution to the segmented font, there is a nice example here.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...