You are here





Even more Pebble adventures ! Now that Skylines was thriving in the Pebble appstore, I decided to generate a watchface for the new Pebble Time, so I had something to show off when my Pebble Time will arrive in August. And what better app could I implement than some colorfull spirographs ?

It took quite a while to finish this : as I didn't had my Pebble Time yet, I had no real hardware to test the app, so I had to rely solely on the Pebble emulator on my computer. Eventually, I came up with a first version which I published on the appstore. However, soon, different people remarked that the app was slow and crash prone. Turned out the app used quite some sine/cosine functions which were the cause of all those slowdowns. Hard to believe that my 20 year old HP pocket calculator was more powerfull than a wearable with a modern ARM chipset !

So it was clear I couldn't use sine/cosine functions. Pebble had a workaround in the SDK with sin_lookup functions which use a precalculated table to come up with this. However, this was mostly oriented to create the movement of analogue watches, and the generated values didn't make any sense to me. So I quickly programmed my own co/sine lookup table, and used the default hypotrochoids equations. This worked a lot better & quicker, but this needed also a lot of iterations to come up with a decent spirograph. And in some cases, the spirograph turned into gibberish. More debugging revealed that this was to events coming in when the Pebble was generating the spirograph, like the flick_wrist_to_update option I added to the watchface.

So eventually, I turned to the default Pebble SDK co/sine_lookup functions, and implemented my own hypotrochoids equations with it. This time, all worked well without any glitches. The result is Spiro, a colorfull watchface for the Pebble Time, and the original Pebble (only in B&W off course)..



Now that my Pebble NMBS app is wrapped up, I decided to have a look at the SDK2 for Pebble, and build a watchface for it. I didn't need to search long for some inspiration for a new watchface : on the Moto360, someone made clever use of the black horizontal bezel at the bottom of the screen, adding some scenery to it, as if it was some shadow (default was a man sitting on a bench in the park). So I took the skyline of Prague, converted it to B&W, and I got my first watchface, which I called Skylines.

The app has been extended currently with skylines up to 30 cities from all over the world. I also included a random mode, where the skyline changes every two hours. Just like you're on a world trip ! I also added a Night mode, where the screen inverts and a beautifull night sky appears between 8pm and 6am.

All in all, programming in C went quite well, considering I didn't touched C during the last 20 years. Only problem was the implementation of the configuration window, which was a bit of a hassle. Turned out I defined my app as SDK3 compatible, which seemed the cause of the errors.

Pebble NMBS app, version 0.3


I just build version 0.3 of my Pebble NMBS app, which is the real first beta. I added the station choice as user configuration items in this version. It took quite a while to figure out how to implement this, as the CloudPebble emulator seems not to have the support for testing this. Anyhow, the next steps are adding app metadata, such as official icons and a screen example. And I'll probably need to change its name before I can release this app on the Pebble appstore.

I also remarked that there is already an NMBS app on the appstore although in French. Seems that both apps have quite some similarities, although my app shows more info ;) Anyhow, I like some competition.

After the appstore release, time to dig into PebbleSDK 3.0, so the app will have Timeline support when I'll receive my Pebble Time Steel !

Edit : and it's live on the appstore !

A Pebble NMBS app


Since I have a Pebble smartwatch, I've allways wanted to dive into Pebble programming. And of course finding at the same time a solution for one of my itches. When communting by train, checking the NMBS Android app can sometimes be a hassle, certainly if you're carrying a laptop bag while descending the stairs. So a Pebble app for quickly checking when your train leaves would be great ! It even has the advantage that this could be written in Javascript, avoiding the default C coding, as my C skills have become quite ruste after all those years.

Developping a Pebble.js app turned out to be quite easy : the most difficult part was understanding JSON (never used it before) and wrapping my head around the iRail API. After a few hours, I got a first prototype running, which showed me the next 5 trains leaving Brussels-South, together with the departure time, platform and duration of the trip. Today, I've added an option to choose your starting point, reaching a point at which this could be called a first alfa release.

There's still more work to do : not everyone uses the same commute stations as I do (they are currently hardcoded into the app), so those need to be configuration items in the app. So this needs to be addressed first before I can release it into the wild.
Also, the app currently only supports direct connections. There's some administrative work to do for releasing it on the Pebble appstore. The code currently lives in CloudPebble, I need it to import it into my local git repo as the code changes dramatically from day to day (really need to install GitLab onto my machine too). And finally, converting it to SDK3 for the new Pebble Time, so the departure times could appear into your timeline.

Subscribe to RSS - Programming