Could the Pebble vibrate when users arm is up a set time


My daughter is ten and suffered a stroke a few months ago. Because of the stroke, she has a lot of tone in her arm. This causes her arm to pull up close to her body instead of naturally resting down and at her side. She has to make a conscience effort to put her arm down and we are frequently reminding her. School is starting soon and I started thinking if there is a way to use the Pebble’s accelerometer and vibrate feature to provide reminders that are more subtle. Could the Pebble detect if her arm is in the upright position (right side of watch facing up) for let’s say 30 seconds and trigger a notification vibration? Is this even possible?


Hi Dale,

This is technically possible, but it will require a specific app to be developed.
I’m sure you can find someone nice enough on this forum write one for you.

(Also, the app will have to be always running on the Pebble since it is not possible for a program on the Pebble to do something in the background)


It’s a very simple feature, as i have something similar running, and I can add it to my watchface.


Would anyone be willing to help me with this?


Hey Dale, try this:


Dale, if your daughter enjoys any of my watchfaces here:, please tell me which one and I can make a custom version for you that reminds her to put her arm down.

Otherwise I would be happy to make some watchface or custom app for her so the watch doesn’t have to look like it’s only there for the stroke. Hope I can help!


We truly have some really great people in this community. Good work guys. It warms my heart seeing you guys jump right in and offer assistance like this. Hats off to all of you.


Can you describe the angle of the hand? I guess it’s not exactly straight Up.

Ron said:
Can you describe the angle of the hand? I guess it's not exactly straight Up.

Wouldn’t be more flexible to implement a “learning mode” in the watchapp/face;

Basically you open the settings on the phone and select some “Learning mode” option, and the Pebble will do a 5 seconds countdown before starting recording the “arm up” position for, let’s say 10 seconds, before analysing the samples, and storing the relevant data for normal operation (that is detecting when the arm is up for more than 30s).

That’s just a thought.


I’ve been working on learning mode for some time. It’s not ready, and I have few other bog tasks with priority.
One simple way to answer the position question is to record real movement with one of the dedicated applications like my acc_log. It’s data are available to the user who record with it.

It works!!!

We are SO truly grateful for your help. My daughter was so excited to hear people were willing to help.

Thank you orviwan for getting me started. I've had a steep learning curve this afternoon but it was worth it. I had zero experience with Pebble before this. I'm borrowing my friend's watch and loaded the app today. At first it didn't work so I uploaded it to CloudPebble like you suggested. I removed the '&& data[i].y>=600' part since we only need to worry about the x direction. I changed 'data[i].x<=-400' to 'data[i].x<=-600' so it would trigger at a higher position. I also dropped the delay to 10.

Magnitude, thank you for the offer. Looking 'normal' is important. The stroke happened at the end of school last spring; she won't admit it but she is really worried about sticking out. She really likes the Bold watchface. If you could add the functionality that orviwan got us, she'd love it.

Ron and LeFauve, the 'learning mode' is a great idea. It would really help people 'dial in' the position they are working on. My daughter's Occupational Therapist thinks this would be helpful for many others. As users make progress, 'learning mode' would help them make adjustments as they improve. Being able to set the delay would also be helpful.

Finally, I thought of another thing that might help. If she were to accidentally leave the watch sitting on it's left side, it would keep vibrating. Is there a way to add a counter that would stop the app after five notifications?

Again, thank you all so much. I started with an idea and you made it come to life.


Alright, let’s all gather together then and make one awesome app for Dale here. I will merge @orviwan‌’s code for the detection in a few minutes when I hop on a computer. (code has been merged) I will provide the github repo, my code for BOLD (the watchface his daughter likes), and any other side code or assistance that needs handling. @Ron and @LeFauve‌ can provide the learning code.

We will all contribute to the repo on Github located here:

I’m sorry if the Github repo name seems inappropriate or poorly said. I can always change it but I wasn’t sure what to do, sorry.

Devs who are into this, take the code from my repo and add your code in, create a pull request and I will review and merge.

Any time a new “stable” version has been created, we will push it here (and I guess we could put it on the appstore).

Edit: I just merged @orviwan’s code with BOLD. I am now adding in the 5 vibration then stop feature.
Edit 2: Added the set limit to amount of vibrations. See main.h if you want to change the limit through vibes_lock.
Edit 3: Dale, version 1.0 can be found here:
Edit 4: Version 1.1 can be found below with an explanation and stuff of new features.


Well done @Magnitude!

@Dale, if you don’t have a Pebble already, I would recommend you get a “normal” model, not the “Steel” because many people on the forum complained about the Steel vibrator being both not strong enough to be noticed and noisy because it makes the watch’s case vibrating and you can actually hear it.


@Magnitude This is excellent!

She’s going to love the watchface.

One thing I noticed… once it vibes in the up position, we get one more vibe right after she puts her arm down. Not sure why.

Another dream feature I thought of… could the watchface display a count of vibes/day to show her progress.


@LeFauve that’s helpful advice. Fortunately she likes the look of the normal Pebble over the Steel. Good for Dad because we save $100. Plus she likes the bright color options.


I finished 1.1. I changed it from a watchface to a watchapp to allow for button interaction. I overrode the back button so it’s not accidentally hit and the app is exited. To exit the app, long press the back button for about 3 seconds. Press the select button to show the stats screen. It looks like this:


This works great! We’ve been doing some practical testing today. It seems to be making a difference.

I remove the ‘&& data[i].y>=600’ condition so it would trigger when her arm was in the upright position. Y stays below 100. Just tracking the X seems to work fine.

We’re still getting a vibe after she puts her arm back down. This started after the vibe lock feature was added. She doesn’t mind. She says it’s the ‘good job’ vibe.


This is just great Dale, please keep us updated on her progress. Wish her luck in school from me!

Dale said:
This works great! We've been doing some practical testing today. It seems to be making a difference.

I remove the '&& data[i].y>=600' condition so it would trigger when her arm was in the upright position. Y stays below 100. Just tracking the X seems to work fine.

We're still getting a vibe after she puts her arm back down. This started after the vibe lock feature was added. She doesn't mind. She says it's the 'good job' vibe.

Glad it’s working! Hoping the best for her in school, as well.

I removed the &&… part as you requested. For the life of me I cannot replicate the vibe after putting arm down. I hold my arm up, it vibrates, I put it down into a horizontal position and it doesn’t seem to be doing anything… Sorry.

Here’s 1.2, which has the fix mentioned above:
(1.1 can be found in your directory now, too).

If there is anything else I can do for you, such as add this into another watchface or whatever don’t hesitate to ask. I’ll always be a keyboard away :slight_smile:


Great work Magnitude, i was busy with adding an learning button based on V1.0.

When you push the middle button for 2 seconds, then it wil take the actual position for X and Y.
The Pebble will give a short vibe to let you know the new positions are learned.
These values for X and Y are also stored in the pebble, so it will use these from start-up next time.

I did not knew that you where making a new version, otherwise i had add this to V1.1.

I will attach a link to the source, so you can have a look and maybe you can add this to your project.
In my example i only use X to detect the position of the arm, but X and Y are learned (in case of needed).
I also used a different font and BT_Icon because that was missing at the time i looked in the git.

It’s great you do this, much appreciated !!