kTimepiece - A clock application for kindle
Here is a little application I've been working on this weekend. It's just something I wanted on my kindle for a long time. It basically draws a simple clock on screen, and updates it every second/minute.
Most of the code is based on geekmaster's dithermatron, although I admit that I using just a little of the magic that the code offers.
The center of the clock is cleared and the hands are redrawn at each update; the background is drawn from an external file when you start the app.
(After the screensaver kicks in, in no longer gets updated, so it would be a good idea to use ~disableScreensaver to prevent that. ) - not anymore.
The background image location is hardcoded, so you have to put the binary and the .png file on the root folder. (/mnt/us/)
I know it's not very advanced, (it's kinda reinventing the wheel), and there are still things that could improve, but I decided to share this with you.
Update: Added launchpad actions to start/kill clock, and prevent screensaver. Use T S to start and T Q to quit.
TODO:
- Keep track of the pixels drawn in the previous loop, so only those are cleared.
- Flash the central part each hour to remove ghosting.
- Un-hardcode the background image location, so it can be moved to a separate folder.
Enjoy.
Last edited by kiri87; 04-29-2012 at 03:33 PM.
|