Page 1 of 1

Bin Clock -Test-

Posted: Tue Jan 03, 2017 1:24 am
by Operator
Finally some free time to read all the posts
and program again a bit... :)

Code: Select all

REM Bin-Clock:inspired by a Xmas gift
REM 1 col. hours:   0-23 / 6bit
REM 2 col. minutes: 0-59 / 6bit
REM 3 col. seconds: 0-59 / 6bit
REM sB5.6/iPhone4/iOS6.1/ by Operator

FOR i = 5 TO 0 STEP -1
  FIELD "sec"&i TEXT " "&2^i AT 200,240 -(i*40) SIZE 30,30 RO
  FIELD "min"&i TEXT " "&2^i AT 140,240 -(i*40) SIZE 30,30 RO
  FIELD "hou"&i TEXT " "&2^i AT  80,240 -(i*40) SIZE 30,30 RO
NEXT i

LOOP: SLOWDOWN 
FOR i = 0 TO 5
  IF BIT(CURRENT_SECOND(),i) THEN FIELD "sec"&i BACK COLOR 0,1,0 ELSE FIELD "sec"&i BACK COLOR 0,0,0
  IF BIT(CURRENT_MINUTE(),i) THEN FIELD "min"&i BACK COLOR 0,1,0 ELSE FIELD "min"&i BACK COLOR 0,0,0
  IF BIT(CURRENT_HOUR(),i) THEN FIELD "hou"&i BACK COLOR 0,1,0 ELSE FIELD "hou"&i BACK COLOR 0,0,0
NEXT i
GOTO LOOP

Re: Bin Clock -Test-

Posted: Thu Jan 05, 2017 5:34 pm
by Joel
Cool thing... I enjoyed it very much...simple, elegant and efficient code and a lot of fun to look at.
Thanks, Joel

Re: Bin Clock -Test-

Posted: Thu Jan 05, 2017 5:58 pm
by rbytes
I agree. I love clocks, and Operator, yours is simple yet elegant. It is a little hard for me to keep up with the seconds, but with a little practice I should get faster. :lol:

Thanks for posting it.