Hi there!
I got a Pebble smartwatch couple of weeks ago.
To my relief, it was all I thought it would have been. Slick, comfortable, and most of all, PROGRAMMABLE!
The SDK needed for programming the device, comes for free, you don't have to pay any subscription or license and programming is done in plain C (not C++, C#, Objective C and the likes). Programming in ANSI C has some air of nostalgia, it took me back 20+ years!
The PebbleOS itself is small and manageable, making it easy for novices to start tinkering.
The SDK comes with a few examples to help you get the grips of programming the Pebble, one of which is a "fuzzy clock" that tells the time in the way humans used to do when the clocks and watches had handles instead of digital displays.
Playing around, I changed it to tell the time in Greek, using latin characters (Greek fonts are not included and it takes a bit of playing around to make the Pebble work with non latin characters. That said, if you need to add non latin characters, you will find all the needed info in the official Pebble forum).
The greek fuzzy time facewatch is like this:
The greek fuzzy time watchface can be downloaded from here. This link includes the complete project along with the source code and binary.
If you want just the binary, you can get it here.
Just a word of caution though, it has been compiled using SDK 2.0 BETA 2, I don't know it it runs on Pebbles with previous version of firmware but if it doesn't, you can always compile it yourselves using the files of the first link.
The code itself is very simple and the bit that does the actual time conversion has as follows:
Thanks for reading,
G.
UPDATE:
Fixed a minor bug that produced wrong readings at x:58 and x:59. Correction is shown above in bold.
Downloadable archive and binary have also been fixed.
I got a Pebble smartwatch couple of weeks ago.
To my relief, it was all I thought it would have been. Slick, comfortable, and most of all, PROGRAMMABLE!
The SDK needed for programming the device, comes for free, you don't have to pay any subscription or license and programming is done in plain C (not C++, C#, Objective C and the likes). Programming in ANSI C has some air of nostalgia, it took me back 20+ years!
The PebbleOS itself is small and manageable, making it easy for novices to start tinkering.
The SDK comes with a few examples to help you get the grips of programming the Pebble, one of which is a "fuzzy clock" that tells the time in the way humans used to do when the clocks and watches had handles instead of digital displays.
Playing around, I changed it to tell the time in Greek, using latin characters (Greek fonts are not included and it takes a bit of playing around to make the Pebble work with non latin characters. That said, if you need to add non latin characters, you will find all the needed info in the official Pebble forum).
The greek fuzzy time facewatch is like this:
The greek fuzzy time watchface can be downloaded from here. This link includes the complete project along with the source code and binary.
If you want just the binary, you can get it here.
Just a word of caution though, it has been compiled using SDK 2.0 BETA 2, I don't know it it runs on Pebbles with previous version of firmware but if it doesn't, you can always compile it yourselves using the files of the first link.
The code itself is very simple and the bit that does the actual time conversion has as follows:
#include "string.h"
static const char* const HOURS[] ={
"Dodeka",
"Mia",
"Dyo",
"Tris",
"Tesseris",
"Pente",
"Exi",
"Efta",
"Okto",
"Ennia",
"Deka",
"Enteka"
};In a coming post I will go through the process of adding greek fonts.
static const char* const MINUTES[] = {
" akribos",
" kai pente",
" kai deka",
" kai tetarto",
" kai eikosi",
" kai eikosipente",
" kai misi",
" para eikosipente",
" para eikosi",
" para tetarto",
" para deka",
" para pente"
};
static size_t append_string(char* buffer, const size_t length, const char* str) {
strncat(buffer, str, length);
size_t written = strlen(str);
return (length > written) ? written : length;
}
void fuzzy_time_to_words(int hours, int minutes, char* words, size_t length) {
int fuzzy_hours = hours;
int fuzzy_minutes = ((minutes + 2) / 5);
if (fuzzy_minutes ==12) { fuzzy_minutes =0; fuzzy_hours++;}
if (fuzzy_minutes>6) { //increase hour and use "para"
fuzzy_hours++;
}
if (fuzzy_hours>12){
fuzzy_hours-=12;
}
size_t remaining = length;
memset(words, 0, length);
remaining -= append_string(words, remaining, HOURS[fuzzy_hours]);
remaining -= append_string(words, remaining, MINUTES[fuzzy_minutes]);
}
Thanks for reading,
G.
UPDATE:
Fixed a minor bug that produced wrong readings at x:58 and x:59. Correction is shown above in bold.
Downloadable archive and binary have also been fixed.
