ATtiny Watch Core

Google+ Pinterest LinkedIn Tumblr +

8K flash has no sufficient room to retailer all characters in giant font measurement. (corresponding to 24 pixels font peak)

As watch solely require 10 digital characters, we are able to tailor-make a specific font kind binary to slot in restricted area.

I’ll use imagicmagick command line instruments to point out how one can convert customized font characters to a c header file.

This program want 10 digit in 2 font sizes, one with font peak eight pixels to point out date digits and one with font peak 24 pixels to point out time digits:

convert -depth 1 -font Lucida-Sans-Unicode -pointsize 11 label:00123456789 -crop 70x8+7+four -flip -rotate 90 watch_digit.xbm

convert -depth 1 -font Cooper-Black -pointsize 25 label:00123456789 -crop 150x24+14+four -flip -rotate 90 watch_3x_digit.xbm

Lucida-Sans-Unicode and Cooper-Black are the font kind in Windows 7, chances are you’ll use your chosen font kind in your OS.

The corp, flip and rotate choice assist to regulate the binary information in appropriate place and course. You could change the output format from xbm to png to preview the output bitmap.

After export the xbm recordsdata, we are able to copy the font binary code to the watchdigit.h supply file:

#embrace <avr/pgmspace.h>

#outline FONTWIDTH 7
#outline FONT3XWIDTH 15

static const uint8_t watch_digit[] PROGMEM = ;

static const uint8_t watch_3x_digit[] PROGMEM = ;

Ref.:

http://www.imagemagick.org/script/index.php

Read more

Share.

Leave a Reply

%d bloggers like this: