### simple graphic clock

Place to put your Basic demos and examples

Moderator: Mmiscool

### simple graphic clock#35848

By cwilt
#35848 Just getting started.

Code: Select all`print "Graphic Clock" print graphics 500 500 gcls gosub [drawhour]gosub [drawminute]end[drawhour]mytime = time("hour")x = mytime * 15x = x / 57.29577951xx = sin(x)xx = xx * 200xx = 250 + xxyy = cos(x)yy = yy * 200yy = 250 - yyline 250 250 xx yyreturn[drawminute]mytime = time("min")x = mytime * 6x = x / 57.29577951xx = sin(x)xx = xx * 200xx = 250 + xxyy = cos(x)yy = yy * 200yy = 250 - yyline 250 250 xx yy 12return`

### Re: simple graphic clock#35849

By heckler
#35849 Very nice!
that's some fancy math.

runs on an esp -01 module

dwight

### Re: simple graphic clock#35853

By Mmiscool
#35853 Modified your demo so it will update the clock face every 5 seconds.

Do you mid if I post this demo on the esp8266 basic web site?

Code: Select all`onload [drawClock]wprint "<meta http-equiv='refresh' content='5;URL=/input?'>"print "Graphic Clock" print graphics 500 500 [drawClock]gcls gosub [drawhour]gosub [drawminute]wait[drawhour]mytime = time("hour")x = mytime * 15x = x / 57.29577951xx = sin(x)xx = xx * 200xx = 250 + xxyy = cos(x)yy = yy * 200yy = 250 - yyline 250 250 xx yyreturn[drawminute]mytime = time("min")x = mytime * 6x = x / 57.29577951xx = sin(x)xx = xx * 200xx = 250 + xxyy = cos(x)yy = yy * 200yy = 250 - yyline 250 250 xx yy 12return`

### Re: simple graphic clock#35861

By cwilt
#35861
Mmiscool wrote:Modified your demo so it will update the clock face every 5 seconds.

Do you mid if I post this demo on the esp8266 basic web site?

Code: Select all`onload [drawClock]wprint "<meta http-equiv='refresh' content='5;URL=/input?'>"print "Graphic Clock" print graphics 500 500 [drawClock]gcls gosub [drawhour]gosub [drawminute]wait[drawhour]mytime = time("hour")x = mytime * 15x = x / 57.29577951xx = sin(x)xx = xx * 200xx = 250 + xxyy = cos(x)yy = yy * 200yy = 250 - yyline 250 250 xx yyreturn[drawminute]mytime = time("min")x = mytime * 6x = x / 57.29577951xx = sin(x)xx = xx * 200xx = 250 + xxyy = cos(x)yy = yy * 200yy = 250 - yyline 250 250 xx yy 12return`

Thats what I had planned to do with it but I ran out of time last night.

Of course you can use it.