[Watch app] Stopwatch [v2.0]

KatharineKatharine Posts: 591Member, Administrator, Moderator admin
edited December 2013 in Pebble Watchapp Directory
A stopwatch, now updated for SDK 2! The design is generally in line with the general Pebble aesthetic (I think).

Here are some pictures:

image  image

It has decisecond precision and displays up to four laps on the main screen. Additionally, up to thirty can be seen be holding the 'lap' button.

You can download stopwatch.pbw or look at the (messy) source.

I am not responsible if this bricks your pebble, though I have no particular reason to think it would.

Post edited by Katharine on
Sparkly Code Princesskatharine@getpebble.com. I prefer email to forum PMs.
CloudPebble Online IDE | Pebble Stopwatch | <3
Legacy: httpebble | Peapod
There are two As in my name.
«13

Comments

  • JoshuaHibbertJoshuaHibbert Posts: 11Member
    edited April 2013
    First thing I noticed: your MacBook needs a clean!

    Thanks for this :)
    Post edited by JoshuaHibbert on
    iPhone 5 • Kickstarter backer (April 24th, 2012)
  • TomDRozaTomDRoza Posts: 2Member
    edited April 2013
    Nice work! I really like this - it looks exactly how I imagine an official Pebble stopwatch would have looked if the watch has shipped with one pre-installed. Hopefully a version that shows tenths of seconds is possible too?
    Post edited by TomDRoza on
  • KatharineKatharine Posts: 591Member, Administrator, Moderator admin
    I'm not convinced tenths of a second can be done accurately, though I haven't really looked into it. I intend to take a look, but I fear that I'd just be misleading by displaying a set of digits that has no real meaning besides looking good.

    It currently relies on the pebble clock, which I believe to be accurate but only keeps time to the second.
    Sparkly Code Princesskatharine@getpebble.com. I prefer email to forum PMs.
    CloudPebble Online IDE | Pebble Stopwatch | <3
    Legacy: httpebble | Peapod
    There are two As in my name.
  • JoshuaHibbertJoshuaHibbert Posts: 11Member
    Now you just need to add an icon!
    iPhone 5 • Kickstarter backer (April 24th, 2012)
  • CaffeineJunkieCaffeineJunkie Posts: 2,227Moderator mod
    Katherine, they won't be firing off the tick event, but will be using a separate timer which can have intervals less than a second.
    Forum Moderator  iPhone 6 Plus
  • KatharineKatharine Posts: 591Member, Administrator, Moderator admin
    edited April 2013
    CaffeineJunkie: I realise that, and that's how I'd do it – but if I ask for a timer every 100ms, am I actually going to get one every 100ms (versus, say 130ms)? The timing guarantees aren't documented.
    Post edited by Katharine on
    Sparkly Code Princesskatharine@getpebble.com. I prefer email to forum PMs.
    CloudPebble Online IDE | Pebble Stopwatch | <3
    Legacy: httpebble | Peapod
    There are two As in my name.
  • RichardGRichardG Posts: 272Member
    edited April 2013
    I don't know why but every time I tried to open it on my phone, it was downloading it as a zip.

    Also, would be good to see some button indicators and milliseconds displayed for short timing.
    Post edited by RichardG on
  • cthoncticcthonctic Posts: 33Member
    The 'here' link for version two downloads a text file. I suppose simply changing .txt to .pbw will do the trick? For the time being, I grabbed the package from RichardG's Dropbox link. 
    Nexus 4 AOKP 4.2.2 franco.Kernel |  Kickstarter early bird backer  |  black Pebble 
  • JoshuaHibbertJoshuaHibbert Posts: 11Member
    @cthonctic It shouldn't; the URL of that link is: http://kathar.in/stopwatch.pbw
    iPhone 5 • Kickstarter backer (April 24th, 2012)
  • CaffeineJunkieCaffeineJunkie Posts: 2,227Moderator mod
    Some browsers open them as text files apparently.
    Forum Moderator  iPhone 6 Plus
  • cthoncticcthonctic Posts: 33Member
    Yep, mobile Chrome Beta opens stopwatch.txt while Opera automatically downloads the pbw correctly. Weird. 
    Also, some of the pbw packages oddly want to be opened as PDF with the Pebble app not being an option but using ES File Explorer it's still been possible to install them. *shrugs*
    Nexus 4 AOKP 4.2.2 franco.Kernel |  Kickstarter early bird backer  |  black Pebble 
  • MikeDorriesMikeDorries Posts: 2Member
    I've used the ES File Explorer to rename the file to remove the .txt, replacing it with .pbw and they install after that.
  • DouweMaanDouweMaan Posts: 100Member
    Wow, that looks amazing! Great job Katherine!
  • LooseunitLooseunit Posts: 28Member
    That is brilliant. 
    My only (humble) suggestion would be to reverse the top and bottom button mappings so that the lap timer is at the bottom - I was just testing it and found I naturally wanted to press the bottom button for the lap timer. So naturally I reset the stopwatch instead of timing laps... 
    I may be in the minority here, although I've seen others mention elsewhere for different ideas that the bottom button is the easiest to access, and lap time would possibly be the one needing easiest access (even if not used the most). 
    • Samsung Galaxy S4 (4.2.2) + Galaxy Tab 7.7 (4. 1.2) + Samsung Galaxy Note 10.1 (4.1.2)
    • Pebbles: 3xBlack  1xRed 1xOrange - ALL DELIVERED 
    • BT: Motorola T505 handsfree, Motorola S9-HD headset, Blueant T1 headset, Celluon IR keyboard, Polar HRM, PLX OBDII vehicle adapter (I think I like wireless things...)
  • AlgusAlgus Posts: 51Member Pebbler

    Some browsers oextensionas text files apparently.

    I'm on Android (Nexus 4 + Cyanogenmod) and 'stock' browser indeed opens pbw file as text. Luckily there is a 'save link' option (long tap the link) which downloads pbw which I can open from 'downloads' app/file manager or straight from notifications when download completes.

    By the way, for some strange reason Opera Mini replaces 'pbw' extension with 'zip' when asked to download.

    Pebble firmware with non-english language support: http://pebblebits.com/firmware/
  • AlgusAlgus Posts: 51Member Pebbler

    Version two!


    Source is still in the same place, but the download URL has changed. You can now find it here.

    It now features hundredths of a second and a menu icon!

    Here's a new picture:

    image

    (I wish I was allowed to edit my posts!)
    Great app, thanks so much!
    Pebble firmware with non-english language support: http://pebblebits.com/firmware/
  • KatharineKatharine Posts: 591Member, Administrator, Moderator admin
    cthonctic said:
    The 'here' link for version two downloads a text file. I suppose simply changing .txt to .pbw will do the trick? For the time being, I grabbed the package from RichardG's Dropbox link. 
    I've modified the webserver configuration and people may now have better luck downloading the thing. Or maybe not; I have no way of testing.


    Looseunit said:
    That is brilliant. 
    My only (humble) suggestion would be to reverse the top and bottom button mappings so that the lap timer is at the bottom - I was just testing it and found I naturally wanted to press the bottom button for the lap timer. So naturally I reset the stopwatch instead of timing laps... 
    I may be in the minority here, although I've seen others mention elsewhere for different ideas that the bottom button is the easiest to access, and lap time would possibly be the one needing easiest access (even if not used the most). 
    Perhaps? I think they're about equally easy to access, except that my watch has a slightly awkward down button that doesn't press very nicely.
    Sparkly Code Princesskatharine@getpebble.com. I prefer email to forum PMs.
    CloudPebble Online IDE | Pebble Stopwatch | <3
    Legacy: httpebble | Peapod
    There are two As in my name.
  • dersiedersie Posts: 1,085Member
    Hello,

    I'm testing the two Stopwatch made yesterday.

    The first
    image
    Has 43s off on 3H.

    For this
    image

    I'm just starting the test but in 30min it advance for 6s.
    I will see for 3H like the other.

    It's a very high mesurement error.....

    The good method to make a stopwatch is to store the start time and after you have just to substract current time. In this way, even if the watch is power off or if you change for an other app, you can always display the good value for the stopwatch. It need just a non volatile memory to store the start time.


  • KatharineKatharine Posts: 591Member, Administrator, Moderator admin
    edited April 2013

    dersie said:
    The good method to make a stopwatch is to store the start time and after you have just to substract current time. In this way, even if the watch is power off or if you change for an other app, you can always display the good value for the stopwatch. It need just a non volatile memory to store the start time.
    That's not possible; the Pebble clock only gives time to the nearest second – and, as I mentioned I feared above, timers are not actually accurate. The original version of my app actually does do this and for this reason only gives times to the second – but it does so accurately, which is probably better.

    dersie said:
     In this way, even if the watch is power off or if you change for an other app, you can always display the good value for the stopwatch. It need just a non volatile memory to store the start time.
    There is no access to non-volatile memory available. That said…

    dersie said:
    It's a very high mesurement error.....
    It's actually in the range of 0.3%, which isn't really "very high". Some sort of hybrid scheme wherein it switches to the pebble clock after five minutes or so might work.

    It does surprise me that it seems to run fast. I would've expected it to run slow.
    Post edited by Katharine on
    Sparkly Code Princesskatharine@getpebble.com. I prefer email to forum PMs.
    CloudPebble Online IDE | Pebble Stopwatch | <3
    Legacy: httpebble | Peapod
    There are two As in my name.
  • dersiedersie Posts: 1,085Member
    edited April 2013
    I'm at 1H09 (Real time) and I have 13s more on your Stopwatch. It seem constant drift.

    if it extrapolating on 3H is nearly the same error as the other. But the other stopwatch is late by 43s and your seem advance.

    Pebble clock can give the actual time with hours, minutes and seconds no ?



    Post edited by dersie on
  • DouweMaanDouweMaan Posts: 100Member

    dersie said:
    The good method to make a stopwatch is to store the start time and after you have just to substract current time. In this way, even if the watch is power off or if you change for an other app, you can always display the good value for the stopwatch. It need just a non volatile memory to store the start time.
    That's not possible; the Pebble clock only gives time to the nearest second – and, as I mentioned I feared above, timers are not actually accurate. The original version of my app actually does do this and for this reason only gives times to the second – but it does so accurately, which is probably better.
    You could use the second tick to correct the manually incremented time every second. That would maintain accuracy, while keeping the slightly less accurate 100milliseconds for effect. Within that one second, the 100ms should be pretty accurate still.
  • dersiedersie Posts: 1,085Member
    edited April 2013
    I think to make a stopwatch with a precision of 1s is already well on the pebble.

    As
    with the storage of the day, hour
    , minute and second of the stopwatch start, we can remain accurate to a second continuously and for hours and even days. It's better than 6s for 30min ;)

    Post edited by dersie on
  • DouweMaanDouweMaan Posts: 100Member
  • EthanGutmannEthanGutmann Posts: 3Member
    Thanks for this, looks like a great app. I haven't tried it yet (waiting for the iOS update or more free time) but does showing the tents of seconds drain battery faster? I wonder if it would make sense to only show seconds counting, but record tenths when the user hits lap or stop? Also a request for more laps (assuming it is still limited to 3.8…). These could then be scrolled through after stopping by hitting up/down buttons. Ethan
  • KatharineKatharine Posts: 591Member, Administrator, Moderator admin
    edited April 2013
    There is almost certainly a non-trivial power drain in updating the tenths of a second (though the actual screen redrawing for them is minimal). For the periods I expect this to be running for I don't expect it to be an issue, but if you're concerned the earlier version (which is still up at RichardG's dropbox link) only counts seconds and is about as accurate as the latest version.

    It actually now displays exactly four laps (and knows five, for animation purposes). As for displaying more laps – there are a couple of issues with that. First is that the up/down buttons are still active; resetting the watch while it's paused is useful. Making new laps while it's paused could perhaps be dropped, but for now it still works. Beyond that, due to the very finite amount of memory available (and the lack of support for run-time memory allocation) I have to pick some bound on the number of laps. For now, at least unless I get the UI figured out, I'll probably leave it at four.
    Post edited by Katharine on
    Sparkly Code Princesskatharine@getpebble.com. I prefer email to forum PMs.
    CloudPebble Online IDE | Pebble Stopwatch | <3
    Legacy: httpebble | Peapod
    There are two As in my name.
  • EthanGutmannEthanGutmann Posts: 3Member
    Thanks, I agree, for time periods it will be running, power may not be an issue, it just seems like the more power optimizations the better :). I hadn't thought about the UI issues with reset. I wonder if you could change reset to be a double tap, you would probably have to maintain some internal timer between taps, and I don't know if other issues with the SDK would prevent that anyway, just a thought. (And of course if somebody tapped twice to scroll two lines, that would reset it, so maybe not the best idea...) When the accelerometer data are available, maybe something could be done with it to scroll...? Thanks again.
  • bobhwasatchbobhwasatch Posts: 65Member Pebbler
    Maybe you could have it only show the seconds updating "live" but when the user presses stop or lap it could show the tenths then.
«13
Sign In or Register to comment.