Sunday, May 31, 2015

Fibonacci Watch

There I was on Quora... consuming my regular dose of questions and answers as usual when I stumbled across this invention by a Philippe Chrétien that made me go crazy.



Fibonacci Clock 
(Quora link: http://goo.gl/oUVtZs
(Original Idea: basbrun.com)


The idea was simple yet amazing! Using the fibonacci series to display the time! 

(There's much written about that idea around on the web and copying the words of the author verbatim would be redundant and to give the credit that the man actually deserves, I'm going to refrain from repeating all that and just link his site here.)

After writing a BASIC program to generate the Fibonacci series in school and again in C at college, I hardly came across those numbers.

Maybe a couple more times, when I watched some random youtube videos about the Golden ratio.

I was amazed at how that guy had an idea that these numbers add up to 12 and can be used to show time like a normal clock with 12 numbers and had taken it to a whole new level by actually implementing that idea!

That just pushed me to see if I could write a program to mimic that and in a few minutes, Voila! - A C program that printed the texts like this.

./fibonacci 3 55

ONE1 ONE2 TWO THREE FIVE 

Having already fallen in love with Android wear development and recently on Android wear too, this code then inspired me to kick start a WatchFace, just for fun.

And in a night, a prototype was up on my G watch and this got me high ;-) 

And in another week, a perfect face was ready on the square display of the G watch! Well that was a first for me, at least with some math involved! :P and there's no stopping once I get into this swing of building something new. But usually that wears off after a crude output is seen and I feel I've written the code and learnt a few new tricks. But this was something different.

A little School math involving the Pythagoras Theorem helped to bring the same to the circular face of the Moto 360. 

The watch face also needs an ambient display mode that employs only black and white tones to conserve battery when the display is 'Always On' and I had to innovate there a 'bit' - Pun intended. 

So I decided to replace 
Red with (H)orizonal lines for (H)our .
Green with Vertical lines for Minute.
(B)lue with Mesh for the colour denoting (B)oth.

This (H) and (B) is my cheat sheet for remembering the colours for the time. :-P

A legend could have been added to the space below the clock in the free space to aid the reader to figure the time out. But what's the fun in that!?

And finally decided to even publish it to the PlayStore for all the Geeks out there to relish!

I'll soon be sharing the experience, code and the math for the interested!

This is how 11:40 looks on G Watch & Moto 360.



Ambient Mode for the same time.



Some day now if I manage to learn how to wield a single Photoshop tool right, I promise that the Moto screenshot would be better! :-)

More options to customise the watch, including 'colours palette' are in progress.
Any suggestion are welcome! 

Playstore Link: https://goo.gl/1lq428

Download from PlayStore


Thanks to my wife who verified the math for the WatchFace and also for pushing me to take the idea to fruition, for making me complete it far sooner than expected and most importantly for being more excited about that initial-just-for-fun C code than anybody would be! :-)


Inspired by the Fibonacci Clock invented by Philippe Chrétien