TimesSquare Display Slowdown
Moderators: adafruit_support_bill, adafruit

TimesSquare Display Slowdown

by smros on Thu Jan 03, 2013 1:43 am

Hello, my 6-year old son & I just built this product and he loves it! He especially likes the moon-phase function. However, he's just learning to tell time, and we find that the time scrolls by a little fast for him. I think I have an FTDI cable somewhere, so I should be able to reprogram the watch, but I am wondering if someone can point me to where in the code I can go to slow down the display?

I found a couple of references to "FPS" which I assume is Frames per Second, which may be a place to start. Has anyone else tried this?

Regards,

-Steve
smros
 
Posts: 1
Joined: Thu Jan 03, 2013 1:38 am

Re: TimesSquare Display Slowdown

by pburgess on Thu Jan 03, 2013 2:25 am

Hi Steve,

FPS is calculated based on other factors; it's not something that can be explicitly set.

We can make some tweaks to 'Marquee.pde' to have it scroll at half speed though. We'll just add a second frame counter around the first. This will keep other calculations from getting messed up.

In the variable declarations near the top, add:
Code: Select all | TOGGLE FULL SIZE
static uint8_t f2 = 0;

Around line 228 (or 229 after the above line is added), double the timeout period:
Code: Select all | TOGGLE FULL SIZE
    watch.setTimeout((sum + 8) * 4 * 2); // Sleep after time/date scrolls off left edge

And a couple lines later, initialize both f and f2:
Code: Select all | TOGGLE FULL SIZE
    f = f2 = 0;

Finally, near the bottom of the file, only increment the 'f' counter on every second frame:
Code: Select all | TOGGLE FULL SIZE
  if((++f2 & 1) == 0) {
    if(++f >= 4) {
      curX--;
      f = 0;
    }
  }

(Explanation: every frame, increment f2 and check if the result is even (bit 0 is clear). If so, increment f (the normal frame counter) which controls the sub-pixel scrolling of the text. f2 is never reset to zero because we're just checking the least bit...it's perfectly okay that it 'rolls over' on its own, the result is the same.)
User avatar
pburgess
 
Posts: 2760
Joined: Sun Oct 26, 2008 2:29 am