danaxcove.blogg.se

Flipclock
Flipclock







flipclock
  1. #Flipclock software
  2. #Flipclock code

You can also choose whether you want to see the seconds and the date. From here, you can change the clock design and change the color to white, black or 'panda' mode. If you swipe up, you can access the settings. If you swipe from right to left, you will go to the chronometer mode where you can use the timer, still with this pretty design. The way that Zen Flip Clock works is as follows: just by opening the app, you can access the classic minimalist clock with cards that flip as time passes. All that does is make the display black, but there’s still a glow - the copper tape is an attempt to reduce this light leakage.Zen Flip Clock is a clock app that simulates the analog clock design by reproducing the classic card-turning clock or flip-clock. Instead, there’s a bit of a hack in the sketch to optionally blank it between selected hard-coded hours (eg 7pm-7am). To keep the build simple, there’s no LDR to sense ambient light and dim the display. There is no backlight control and the thing is quite bright. The front plate is attached to the back plate with stacks of standoffs. But I decided to add some protection in the form of two laser-cut clear acrylic plates. This sandwich would actually have been enough, since it stands up OK. The LCD shield goes on top, and Uno underneath to create a quite thick sandwich. This gave me access to the pins I needed for the RTC and the two switches.

#Flipclock software

There was a lot of software in this project so when the time came to go from prototype to final assembly I decided to go to the other extreme and keep it as simple and minimalistic. I connected SET/ADJ push-buttons to 10 & A5 and used 11 & 12 as SDA/SCL for a software I2C to the DS3231 real time clock module. Fortunately that leaves pins 10,11,12,13 and A5 free. This shield has a built-in SD-card reader, but no touch screen. The viewing angle is fairly important, from the wrong angle the display is quite washed out. The only other interaction is a) setting a “window” on the screen and b) filling it with colour data.

flipclock

#Flipclock code

As always, the trick is finding some code which successfully initialises the display (including orientation). The clocks use a simple automatic DLS adjustment class which takes a table of start/end dates. As well as setting the date and time it configures the red/yellow bin cycle (or none) Pressing Set from time display goes to the configuration screen. Pressing Adj from time display cycles through the faces (including a pseudo-face which randomly cycles through faces). The sketch uses all but around 100 bytes of the Uno’s program storage space. There was a little program memory left, so I squeezed in a very simple Pong Clock, again using code from an earlier project. The look is based on this font Triangle ClockĪn adaptation of an eariler project with a triangulated irregular network (TIN) style face, more pretty colours. The LCD colours are appealing, so I experiment with coloured cubes.

flipclock

The LCD inspired me to add in some additional clock “faces”: The angles come from skipping every 4th row of the digit data, so it’s acos(3/4)=41°, close enough to 45°!

flipclock

The time digits change with a detailed 3-step animation (top flap at 41°, 90° and 131°). It’s alternate weeks and I keep forgetting (this display is optional). As a bonus, across the middle there’s a blinking/flipping colon and also a coloured digit indicating the number of days until I need to put out either the rubbish bin (red) or the recycling (yellow). The time is in big digits across the bottom. The main clock display is the day, date and month in smallish flip-style digits across the top of the LCD (landscape mode).









Flipclock