Using the Pebble accelerometer.
The AccelerometerService enables the Pebble accelerometer to detect taps, perform measures at a given frequency, and transmit samples in batches to save CPU time and processing.
For available code samples, see the feature-accel-discs example app.
Change the accelerometer sampling rate.
The sampling rate in Hz (10Hz, 25Hz, 50Hz, and 100Hz possible)
Change the number of samples buffered between each accelerometer data event.
the number of samples to buffer, between 0 and 25.
Subscribe to the accelerometer data event service. Once subscribed, the handler gets called every time there are new accelerometer samples available.
Cannot use accel_service_peek() when subscribed to accelerometer data events.
A callback to be executed on accelerometer data events
the number of samples to buffer, between 0 and 25.
Unsubscribe from the accelerometer data event service. Once unsubscribed, the previously registered handler will no longer be called.
Subscribe to the accelerometer tap event service. Once subscribed, the handler gets called on every tap event emitted by the accelerometer.
A callback to be executed on tap event
Unsubscribe from the accelerometer tap event service. Once unsubscribed, the previously registered handler will no longer be called.
Subscribe to the accelerometer raw data event service. Once subscribed, the handler gets called every time there are new accelerometer samples available.
Cannot use accel_service_peek() when subscribed to accelerometer data events.
A callback to be executed on accelerometer data events
the number of samples to buffer, between 0 and 25.
A single accelerometer sample for all three axes including timestamp and vibration rumble status.
acceleration along the x axis
acceleration along the y axis
acceleration along the z axis
true if the watch vibrated when this sample was collected
timestamp, in milliseconds
A single accelerometer sample for all three axes.
acceleration along the x axis
acceleration along the y axis
acceleration along the z axis
Enumerated values defining the three accelerometer axes.
Accelerometer's X axis. The positive direction along the X axis goes toward the right of the watch.
Accelerometer's Y axis. The positive direction along the Y axis goes toward the top of the watch.
Accelerometer's Z axis. The positive direction along the Z axis goes vertically out of the watchface.
Valid accelerometer sampling rates, in Hz.
10 HZ sampling rate
25 HZ sampling rate [Default]
50 HZ sampling rate
100 HZ sampling rate
Callback type for accelerometer data events.
Pointer to the collected accelerometer samples.
the number of samples stored in data.
Callback type for accelerometer raw data events.
Pointer to the collected accelerometer samples.
the number of samples stored in data.
the timestamp, in ms, of the first sample.
Callback type for accelerometer tap events.
the axis on which a tap was registered (x, y, or z)
the direction (-1 or +1) of the tap
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!