Timesquare - Invert the display

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
djt205
 
Posts: 2
Joined: Thu Apr 18, 2013 2:49 pm

Timesquare - Invert the display

Post by djt205 »

Hi!

First of all, thanks for this awesome kit (and all your other cool stuff) - I've spent many happy hours messing around with the code etc & really like my watches (I've got 2). So far I haven't got them installed in the bands because I've socketed the ATMega and been fiddling around reprogramming it. For this reason, when the board 'sits' on a flat surface, the angle is facing towards you with the display upside-down. Easy, I thought, I'll change the code to invert the driving pins - 0, 0 becomes 8, 8 etc.

I've read and understood about the Port Registers etc but some of the code has me completely stumped. Genius programming though, the results really do look amazingly good.

Could someone give me a pointer on what to look at changing?

Thanks!

Dan

ruscoe
 
Posts: 8
Joined: Wed Jan 16, 2013 11:57 am

Re: Timesquare - Invert the display

Post by ruscoe »

The Watch library is an extension of the Adafruit GFX library, which contains a rotation property that you can set using the setRotation method.

You'll find it on line 439:
https://github.com/adafruit/Adafruit-GF ... it_GFX.cpp

I just did a quick test by modifying this file:
https://github.com/adafruit/TIMESQUARE- ... /Watch.pde

So line 83:

Code: Select all

watch.begin();
Becomes this:

Code: Select all

watch.begin();
watch.setRotation(2);
That flipped the display on my watch so it's readable upside-down.

However, the display returned to the original rotation after a couple of mode changes. Something must be resetting it, so you'll have to figure out what's going on there.

Alternatively, you can always just call watch.setRotation(2) inside the blit method to have it set each time the watch needs to display something, but that isn't a very clean solution.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Timesquare - Invert the display

Post by pburgess »

The moon phase display (Moon.pde) makes use of setRotation() so that it only needs to store bitmaps for half a moon. If you swap the two rotation cases there, and add an initial setRotation(2) globally, the upside-down effect should stick everywhere.

djt205
 
Posts: 2
Joined: Thu Apr 18, 2013 2:49 pm

Re: Timesquare - Invert the display

Post by djt205 »

Thanks for the great responses. That worked perfectly, I was trying to make it much more difficult. Swapped the buttons over in Watch.cpp as well and all is good.

Really love these things!

Dan

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”