## ambientPressure SensorHistory pressure

--- [current-session | 2026-07-26 21:00 | CIQ SensorHistory API::https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html] ---
### Module: Toybox.SensorHistory > Instance Method Details > **getPressureHistory(options as { :period as [Lang.Number](../Toybox/Lang/Number.html) or [Time.Duration](../Toybox/Time/Duration.html) or **Null**, :order as [SensorHistory.Order](../Toybox/SensorHistory.html#Order-module) } or **Null**)** as [SensorHistory.SensorHistoryIterator](../Toybox/SensorHistory/SensorHistoryIterator.html) (1)

### **getPressureHistory(options as { :period as [Lang.Number](../Toybox/Lang/Number.html) or [Time.Duration](../Toybox/Time/Duration.html) or **Null**, :order as [SensorHistory.Order](../Toybox/SensorHistory.html#Order-module) } or **Null**)** as [SensorHistory.SensorHistoryIterator](../Toybox/SensorHistory/SensorHistoryIterator.html)

Get the pressure history for the given period, up to the last power cycle.

This function always returns the most recent pressure samples. The time between each [SensorSample](../Toybox/SensorHistory/SensorSample.html) in the iterator may be device dependent.

Parameters:

*   options — ([Lang.Dictionary](../Toybox/Lang/Dictionary.html)) —

    Dictionary of options. Can be `null`.

    *   :period — ([Lang.Number](../Toybox/Lang/Number.html), [Time.Duration](../Toybox/Time…

…, then the last specified Number of entries are retrieved

    *   :order — ([Lang.Boolean](../Toybox/Lang/Boolean.html)) —

        The order in which to retrieve the samples.

        *   If order is `null`, the samples will be [ORDER\_NEWEST\_FIRST](../Toybox/SensorHistory.html#ORDER_NEWEST_FIRST-const)

        *   Use the ORDER enumeration to explicitly select [ORDER\_NEWEST\_FIRST](../Toybox/SensorHistory.html#ORDER_NEWEST_FIRST-const) or [ORDER\_OLDEST\_FIRST](../Toybox/SensorHistory.html#ORDER_OLDEST_FIRST-const)

Example:

Gets a SensoryHistoryIterator and prints out the pressure value fr…

---

## getElevationHistory barometric pressure raw

--- [current-session | 2026-07-26 21:00 | CIQ SensorHistory API::https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html] ---
### Module: Toybox.SensorHistory > Instance Method Details > **getElevationHistory(options as { :period as [Lang.Number](../Toybox/Lang/Number.html) or [Time.Duration](../Toybox/Time/Duration.html) or **Null**, :order as [SensorHistory.Order](../Toybox/SensorHistory.html#Order-module) } or **Null**)** as [SensorHistory.SensorHistoryIterator](../Toybox/SensorHistory/SensorHistoryIterator.html) (1)

### **getElevationHistory(options as { :period as [Lang.Number](../Toybox/Lang/Number.html) or [Time.Duration](../Toybox/Time/Duration.html) or **Null**, :order as [SensorHistory.Order](../Toybox/SensorHistory.html#Order-module) } or **Null**)** as [SensorHistory.SensorHistoryIterator](../Toybox/SensorHistory/SensorHistoryIterator.html)

Get the elevation history for the given period, up to the last power cycle.

This function always returns the most recent pressure samples. The time between each [SensorSample](../Toybox/SensorHistory/SensorSample.html) in the iterator may be device dependent.

Parameters:

*   options — ([Lang.Dictionary](../Toybox/Lang/Dictionary.html)) —

    Dictionary of options. Can be `null`.

    *   :period — ([Lang.Nu…

…ost recent SensorSample

```
using Toybox.SensorHistory;
using Toybox.Lang;
using Toybox.System;

// Create a method to get the SensorHistoryIterator object
function getIterator() {
    // Check device for SensorHistory compatibility
    if ((Toybox has :SensorHistory) && (Toybox.SensorHistory has :getElevationHistory)) {
        return Toybox.SensorHistory.getElevationHistory({});
    }
    return null;
}

// Store the iterator info in a variable. The options are 'null' in
// this case so the entire available history is returned with the
// newest samples returned first.
var sensorIter = getIterator();

// Print out the next entry in the iterator
if (…

---

## SensorHistory getPressureHistory

--- [current-session | 2026-07-26 21:00 | CIQ SensorHistory API::https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html] ---
### Module: Toybox.SensorHistory > Instance Method Details > **getPressureHistory(options as { :period as [Lang.Number](../Toybox/Lang/Number.html) or [Time.Duration](../Toybox/Time/Duration.html) or **Null**, :order as [SensorHistory.Order](../Toybox/SensorHistory.html#Order-module) } or **Null**)** as [SensorHistory.SensorHistoryIterator](../Toybox/SensorHistory/SensorHistoryIterator.html) (1)

### **getPressureHistory(options as { :period as [Lang.Number](../Toybox/Lang/Number.html) or [Time.Duration](../Toybox/Time/Duration.html) or **Null**, :order as [SensorHistory.Order](../Toybox/SensorHistory.html#Order-module) } or **Null**)** as [SensorHistory.SensorHistoryIterator](../Toybox/SensorHistory/SensorHistoryIterator.html)

Get the pressure history for the given period, up to the last power cycle.

This function always returns the most recent pressure samples. The time between each [SensorSample](../Toybox/SensorHistory/SensorSample.html) in the iterator may be device dependent.

Parameters:

*   options — ([Lang.Dictionary](../Toybox/Lang/Dictionary.html)) —

    Dictionary of options. Can be `null`.

    *   :period — ([Lang.Number](../Toybox/Lang/Number.html), [Time.Duration](../Toybox/Time…

…, then the last specified Number of entries are retrieved

    *   :order — ([Lang.Boolean](../Toybox/Lang/Boolean.html)) —

        The order in which to retrieve the samples.

        *   If order is `null`, the samples will be [ORDER\_NEWEST\_FIRST](../Toybox/SensorHistory.html#ORDER_NEWEST_FIRST-const)

        *   Use the ORDER enumeration to explicitly select [ORDER\_NEWEST\_FIRST](../Toybox/SensorHistory.html#ORDER_NEWEST_FIRST-const) or [ORDER\_OLDEST\_FIRST](../Toybox/SensorHistory.html#ORDER_OLDEST_FIRST-const)

Example:

Gets a SensoryHistoryIterator and prints out the pressure value fr…

⚠ search call #6/8 in this window. Results limited to 1/query. 2 call(s) remaining before block. Batch queries: ctx_search(queries: ["q1","q2","q3"]) or use ctx_batch_execute.


## Session createField depth recording activity type permissions

--- [current-session | 2026-07-26 21:00 | CIQ ActivityRecording API::https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityRecording.html] ---
### Module: Toybox.ActivityRecording > See Also: (1)

## See Also:

*   [Toybox.FitContributor](../Toybox/FitContributor.html)

Example:

```
using Toybox.ActivityRecording;
using Toybox.WatchUi
var session = null;                                             // set up session variable

// use the select Start/Stop or touch for recording
function onSelect() {
   if (Toybox has :ActivityRecording) {                         // check device for activity recording
       if ((session == null) || (session.isRecording() == false)) {
           session = ActivityRecording.createSession({          // set up recording session
                 :name=>"Generic",                              // set session name
                 :sport=>Activity.SPORT_GENERIC,                // set sport type
                 :subSport=>Activity.SUB_SPORT_GENERIC          // set sub sport type
           });
           session.start();                                     // call start session
       }
       else if ((session != null) && session.isRecording()) {
           session.stop();                                      // stop the session
           session.save();                                      // save the session
           session = null;                                      // set session control variable to null
       }
   }
   return true;                                                 // return true for onSelect function
}
```

Since:

API Level 1.0.0

App Types and Runtime Contexts:

*   Background

*   Glance

*   Watch App

---

## createField requires recording session ActivityRecording

--- [current-session | 2026-07-26 21:00 | CIQ ActivityRecording API::https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityRecording.html] ---
### Module: Toybox.ActivityRecording > Instance Method Details > **createSession(options as { :sport as [ActivityRecording.Sport](../Toybox/ActivityRecording.html#Sport-named_type) or [Activity.Sport](../Toybox/Activity.html#Sport-module), :subSport as [ActivityRecording.SubSport](../Toybox/ActivityRecording.html#SubSport-module) or [Activity.SubSport](../Toybox/Activity.html#SubSport-module), :name as [Lang.String](../Toybox/Lang/String.html), :poolLength as [Lang.Float](../Toybox/Lang/Float.html), :sensorLogger as [SensorLogging.SensorLogger](../Toybox/SensorLogging/SensorLogger.html), :autoLap as { :type as [Lang.Symbol](../Toybox/Lang/Symbol.html), :entry as \[ [Position.Location](../Toybox/Position/Location.html), [Position.Location](../Toybox/Position/Location.html) \], :exit as \[ [Position.Location](../Toybox/Position/Location.html), [Position.Location](../Toybox/Position/Location.html) \] } })** as [ActivityRecording.Session](../Toybox/ActivityRecording/Session.html) (1)

### **createSession(options as { :sport as [ActivityRecording.Sport](../Toybox/ActivityRecording.html#Sport-named_type) or [Activity.Sport](../Toybox/Activity.html#Sport-module), :subSport as [ActivityRecording.SubSport](../Toybox/ActivityRecording.html#SubSport-module) or [Activity.SubSport](../Toybox/Activity.html#SubSport-module), :name as [Lang.String](../Toybox/Lang/String.html), :poolLength as [Lang.Float](../Toybox/Lang/Float.html), :sensorLogger as [SensorLogging.SensorLogger](../Toybox/SensorLogging/SensorLogger.html…

…g.Symbol](../Toybox/Lang/Symbol.html), :entry as \[ [Position.Location](../Toybox/Position/Location.html), [Position.Location](../Toybox/Position/Location.html) \], :exit as \[ [Position.Location](../Toybox/Position/Location.html), [Position.Location](../Toybox/Position/Location.html) \] } })** as [ActivityRecording.Session](../Toybox/ActivityRecording/Session.html)

Create a [Session](../Toybox/ActivityRecording/Session.html) object with options determined by the caller.

Only one Session object is allowed to exist at a time. If there is an existing object that has not been closed using the [save()](../Toybox/ActivityRecording/Session.html#save-instance_function) or [discard()](../Toybox/ActivityRecording/Session.html#discard-instance_function) methods, this method will return that object instead of creating a new one. On some products running the 1.x virtual machine, creating a Session object requires a large memory allocation. To free this memory, the

---

## FitContributor field app type watch app data field

--- [current-session | 2026-07-26 21:00 | CIQ ActivityRecording API::https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityRecording.html] ---
### Module: Toybox.ActivityRecording > See Also: (1)

## See Also:

*   [Toybox.FitContributor](../Toybox/FitContributor.html)

Example:

```
using Toybox.ActivityRecording;
using Toybox.WatchUi
var session = null;                                             // set up session variable

// use the select Start/Stop or touch for recording
function onSelect() {
   if (Toybox has :ActivityRecording) { …

…= null) || (session.isRecording() == false)) {
           session = ActivityRecording.createSession({          // set up recording session
                 :name=>"Generic",                              // set session name
                 :sport=>Activity.SPORT_GENERIC,                // set sport type
                 :subSport=>Activity.SUB_SPORT_GENERIC          // set sub sport type
           });
           session.start();                                     // call start session
       }
       else if ((session != null) && session.isRecording()) {
           session.stop();                                      // stop the session
           session.save();                                      // save the session
           session = null;                                      // set session control variable to null
       }
   }
   return true;                                                 // return true for onSelect function
}
```

Since:

API Level 1.0.0

App Types and Runtime Contexts:

*   Background

*   Glance

*   Watch App

Supported Devices:

⚠ search call #7/8 in this window. Results limited to 1/query. 1 call(s) remaining before block. Batch queries: ctx_search(queries: ["q1","q2","q3"]) or use ctx_batch_execute.


Important findings:
1. `Sensor.Info.pressure` returns **barometric pressure calibrated to sea level** - NOT raw ambient pressure. This is a huge issue for depth calculation.
2. `SensorHistory.getPressureHistory()` exists and returns pressure history samples. Need to check if these are raw or calibrated.
3. ActivityRecording is supported in Watch App context with API Level 1.0.0.

Now I need to find if raw ambient pressure is available. The Connect IQ API docs don't seem to have an `ambientPressure` field in Sensor.Info in the older docs I fetched. But newer API levels might have it. Let me search web for "Garmin Connect IQ ambientPressure" and also check SensorLogging module. Also need to check whether `getPressureHistory` returns raw or calibrated values.

Let me also search for `SensorLogging` which might allow raw sensor access, and `ActivityRecording` session with createField for depth.

Also I still need to find Fenix 3 API level. Let me search the web specifically.

Question: "Sensor.Info" ambientPressure Garmin Connect IQ raw pressure API level

Question: Garmin Connect IQ SensorHistory getPressureHistory raw ambient pressure calibrated sea level

Question: Garmin Fenix 3 maximum Connect IQ API level CIQ version supported 1.4


Reviewed 1 sources · synthesized answer with 1 findings

Toybox.Sensor.Info

- [web_fetch] Community/practical context: Overview The Sensor.Info class contains all of the information provided by enabled sensors. Sensor.Info can be retrieved on every call of onUpdate() or it can be obtained on demand

Internal research: web_search ×4, web_fetch ×4, web_fetch_headless ×0

Findings
- [web_fetch] Community/practical context: Overview The Sensor.Info class contains all of the information provided by enabled sensors. Sensor.Info can be retrieved on every call of onUpdate() or it can be obtained on demand

Sources
- [web_fetch] Toybox.Sensor.Info: https://developer.garmin.com/connect-iq/api-docs/Toybox/Sensor/Info.html

Internal tools
Internal research: web_search ×4, web_fetch ×4, web_fetch_headless ×0

Caveat
Evidence is partial: the strongest readable sources were mostly community/practical context.

Toybox.Sensor.Info


Reviewed 3 sources · synthesized answer with 3 findings

Toybox.SensorHistory

- [web_fetch] Community/practical context: source https://developer.garmin.com/connect-iq/core-topics/quantifying-the-user/ sdk 9.1.0 fetched 2026-05-30 generated auto-converted from SDK doc/docs/Core_Topics/Quantifying_the
- [web_fetch] Community/practical context: A collection of Connect IQ apps and libraries Purpose This repo is officially maintained by the Garmin Connect IQ team, containing a small set of reference examples and monkey barr
- [web_fetch] Community/practical context: Overview The SensorHistory module contains the interface for SensorHistory. SensorHistory provides access to historical information recorded by the on-board sensors of device hardw

Internal research: web_search ×1, web_fetch ×4, web_fetch_headless ×1

Findings
- [web_fetch] Community/practical context: source https://developer.garmin.com/connect-iq/core-topics/quantifying-the-user/ sdk 9.1.0 fetched 2026-05-30 generated auto-converted from SDK doc/docs/Core_Topics/Quantifying_the
- [web_fetch] Community/practical context: A collection of Connect IQ apps and libraries Purpose This repo is officially maintained by the Garmin Connect IQ team, containing a small set of reference examples and monkey barr
- [web_fetch] Community/practical context: Overview The SensorHistory module contains the interface for SensorHistory. SensorHistory provides access to historical information recorded by the on-board sensors of device hardw

Sources
- [web_fetch] garmin-dev-skills/skills/garmin-dev/references/connect-iq-docs/portal/core-topics/quantifying-the-user.md at main · athitupakan/garmin-dev-skills: https://github.com/athitupakan/garmin-dev-skills/blob/main/skills/garmin-dev/references/connect-iq-docs/portal/core-topics/quantifying-the-user.md
- [web_fetch] GitHub - garmin/connectiq-apps: A collection of Connect IQ apps.: https://github.com/garmin/connectiq-apps
- [web_fetch] Toybox.SensorHistory: https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html

Internal tools
Internal research: web_search ×1, web_fetch ×4, web_fetch_headless ×1

Caveat
Evidence is partial: the strongest readable sources were mostly community/practical context.

Toybox.SensorHistory


Reviewed 4 sources · synthesized answer with 4 findings

Compatible Devices | Connect IQ

Device API levels

- [web_fetch] Community/practical context: Set of Garmin Connect IQ SDK manifests files with actual list of supported devices Every year Garmin releases a lot of wearables devices with different minimal CIQ SDK levels. The
- [web_fetch] Community/practical context: A collection of Connect IQ apps and libraries Purpose This repo is officially maintained by the Garmin Connect IQ team, containing a small set of reference examples and monkey barr
- [web_fetch] Community/practical context: Approach® S50390 x 390roundAMOLED5.1Approach® S60240 x 240roundMemory-In-Pixel (64 colors)2.4Approach® S62260 x 260roundMemory-In-Pixel (64 colors)3.0Approach® S70 42mm390 x 390rou
- [web_fetch] Community/practical context: TL;DR for any given device, compiler.json in the SDK device folder has the minimum required CIQ version for that device, which is also the maximum expected CIQ version for the app

Internal research: web_search ×2, web_fetch ×8, web_fetch_headless ×1

Findings
- [web_fetch] Community/practical context: Set of Garmin Connect IQ SDK manifests files with actual list of supported devices Every year Garmin releases a lot of wearables devices with different minimal CIQ SDK levels. The
- [web_fetch] Community/practical context: A collection of Connect IQ apps and libraries Purpose This repo is officially maintained by the Garmin Connect IQ team, containing a small set of reference examples and monkey barr
- [web_fetch] Community/practical context: Approach® S50390 x 390roundAMOLED5.1Approach® S60240 x 240roundMemory-In-Pixel (64 colors)2.4Approach® S62260 x 260roundMemory-In-Pixel (64 colors)3.0Approach® S70 42mm390 x 390rou
- [web_fetch] Community/practical context: TL;DR for any given device, compiler.json in the SDK device folder has the minimum required CIQ version for that device, which is also the maximum expected CIQ version for the app

Sources
- [web_fetch] GitHub - AShuba/Garmin-CIQ-Manifests: Set of Garmin Connect IQ SDK manifests files with list of supported devices: https://github.com/AShuba/Garmin-CIQ-Manifests
- [web_fetch] GitHub - garmin/connectiq-apps: A collection of Connect IQ apps.: https://github.com/garmin/connectiq-apps
- [web_fetch] Compatible Devices | Connect IQ: https://developer.garmin.com/connect-iq/compatible-devices/
- [web_fetch] Device API levels: https://forums.garmin.com/developer/connect-iq/f/discussion/354168/device-api-levels

Internal tools
Internal research: web_search ×2, web_fetch ×8, web_fetch_headless ×1

Caveat
Evidence is partial: the strongest readable sources were mostly community/practical context.

Compatible Devices | Connect IQ

Device API levels


The web_explore results are too terse to use effectively. Let me try to fetch known forum threads and documentation pages directly. I know that the Garmin forums have discussions about this. Let me search with more targeted queries and fetch specific pages.

Actually, I should use web_explore for research but the output is just "Reviewed X sources · synthesized answer with Y findings" without showing me the findings. That's not useful. Let me try ctx_fetch_and_index with specific URLs if I can find them, or use ffgrep/web search via ollama if available.

Wait, I have ollama_web_search tool. Let me try that to get actual search results with URLs.

Question: Garmin Connect IQ Sensor.Info ambientPressure raw pressure depth diving barometer

Question: Garmin Fenix 3 Connect IQ maximum API level SDK version CIQ 1.4 2.4

Question: Garmin Venu 2 Connect IQ ambient pressure barometer depth API level 5.0


1. Toybox.Sensor.Info
   URL: https://developer.garmin.com/connect-iq/api-docs/Toybox/Sensor/Info.html
   Toybox.Sensor.Info

# Class: Toybox.Sensor.Info

Inherits: Toybox.Lang.Object

Toybox.Lang.Object

Toybox.Sensor.Info

show all

## Overview

The Sensor.Info class contains all of the information provided by enabled sensors.

Sensor.Info can be retrieved on every call of onUpdate() or it can be obtained on demand. Fields in this class may return`null` so should be checked for`null` values prior to use.

## Instance Member Summary collapse

accel as Lang.Array< Lang.Number> or Null

The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.

altitude as Lang.Float or Null

The altitude above mean sea level in meters (m).

cadence as Lang.Number or Null

The cadence in revolutions per minute (rpm).

heading as Lang.Float or Null

The true north referenced heading in radians.

heartRate as Lang.Number or Null

The heart rate in beats per minute (bpm).

mag as Lang.Array< Lang.Number> or Null

The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).

oxygenSaturation as Lang.Number or Null

The current oxygen saturation in percent (%).

power as Lang.Number or Null

The power in Watts (W).

pressure as Lang.Float or Null

The barometric pressure in Pascals (Pa).

speed as Lang.Float or Null

The speed in meters per second (m/s).

temperature as Lang.Float or Null

The temperature in degrees Celsius (C).

## Instance Attribute Details

### var accel as Lang.Array<Lang.Number> or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Array.html https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.

### var altitude as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The altitude above mean sea level in meters (m).

Elevation is derived from the most accurate source: Barometer or GPS in order of descending accuracy. If no GPS is present, then barometer readings will be used.

### var cadence as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The cadence in revolutions per minute (rpm).

Cadence is derived from (in order of priority):

Bike sensors (cadence or speed must be enabled)

Advanced running dynamics sensors (e.g. heart strap with running dynamics enabled)

Foot pod

Watch-based cadence calculations

### var heading as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The true north referenced heading in radians.

This provides compass orientation if it is supported by the device.

### var heartRate as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The heart rate in beats per minute (bpm).

### var mag as Lang.Array<Lang.Number> or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Array.html https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).

### var oxygenSaturation as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The current oxygen saturation in percent (%)

### var power as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The power in Watts (W).

### var pressure as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The barometric pressure in Pascals (Pa).

This returns barometric pressure calibrated to sea level. Since pressure varies dues to several factors, a GPS-based altitude must first be obtained, then the ambient (local) pressure is measured by the pressure sensor before conversion to a calibrated barometric pressure value.

### var speed as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The speed in meters per second (m/s).

### var temperature as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The temperature in degrees Celsius (C).

---

Generated Jun 8, 2026, 3:42:17 PM

2. Pressure and Depth Measurements on Gamin Devices - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/6354/pressure-and-depth-measurements-on-gamin-devices
   Pressure and Depth Measurements on Gamin Devices - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 0 replies
- Subscribers 15 subscribers
- Views 1924 views
- Users 0 members are here

Options

Related

# Pressure and Depth Measurements on Gamin Devices

Here is a video and some insights on my experience in working with pressure and depth measurements on Garmin devices. My diving apps are available at www.diveiq.com https://www.youtube.com/watch?v=rt-yz88q4LE&t=41s This video shows depth being computed using three different methods for obtaining pressure on Garmin devices.1) Raw ambient pressure: As measured by the pressure sensor.2) Ambient pressure: A smoothed, two-stage filtered pressure provided by Garmin which reduces noise and instantaneous variation.3) Altitude pressure: Pressure derived from the altitude .Many Garmin watches have a pressure sensor that Garmin uses internally to compute altitude. This sensor's data was only available internally to Garmin software and not made available to third party developers. Third party apps such as DiveIQ's Dive Computer and Freedive apps were forced to convert altitude back to pressure. This reverse conversion works pretty accurately but introduces some lag (delay) because it takes a few seconds for pressure changes to reflect on the altitude. Applications deriving pressure from altitude also need to be capable of coping with altitude decalibration because the altitude measurement provided by Garmin does not solely depend on pressure. The altitude also depends on multiple user settings that Garmin uses to determine if changes in pressure are due to changes in weather or changes in altitude. GPS measurements and manual calibrations are also taken into account. Garmin now provides two pressure measurements. A "raw ambient pressure" value taken directly from the sensor and an "ambient pressure" value smoothed by a two-stage filter that reduces noise and instantaneous variation. This video shows shows the response time and accuracy when using each pressure measurement method to compute depth in meters.

- Sign in to reply
- Cancel

3. Raw pressure data - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/1217/raw-pressure-data
   Raw pressure data - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 12 replies
- Subscribers 16 subscribers
- Views 4083 views
- Users 0 members are here

Options

Related

# Raw pressure data

I am trying to develop an app that uses the pressure information from Sensor.Info.pressure. When i test my app on the Fenix 3 i do not get the result i want. When i apply a sudden pressure change the readings do change but after a few seconds the value moves back the the value before i increased the pressure. It looks to me that this is not a raw sensor value but some auto calibrated one. Is there a way to use the raw sensor data?

- Sign in to reply
- Cancel

Is Garmin watching their forum? Anybody?

I would also like access to the raw pressure data as well. I suspect for the same reason - a depth gauge. At the very least a complete and accurate description of what the data we are getting out of GetSensorInfo is so we can manually deconstruct it back into what is needed. The raw info is available as a datafield, so why can we not access it in the API? (The same goes with GPS altitude) Right now the only workaround is to use altitude (from either SensorInfo or ActivityInfo), but since we don't know how exactly how that is derived, any depth calculations base off altitude can not be considered reliable. Thanks

I have plans to look into this further, but it'll have to go into my queue. I'll see what I can find out and try to get an answer by later this week or early next week.

This hasn't been forgotten! I'm talking to the device teams to get an answer on this. Connect IQ doesn't do anything to the data--we're basically just making a request to the OS for sensor data and piping through whatever it returns. If there is any auto-calibration or massaging of the data, it's happening at a lower level. Once I have an answer, I'll post it here. Thanks for your patience!

Thanks Brandon! I will wait patiently. I hope you will come back with good news ;)

> This hasn't been forgotten!

I think it now is forgotten?

Hey guys,This is how I do it in my app.Data available: sensor.altitude (from pressure using baro setting) and sensor.pressure (that really gives the barometer setting adjusted with changes in pressure since that setting was made by user - as far as I understand)Assumption: even a 100mb change in pressure (which is huge) will only impact the result by only 10cm under water, so it's quite negligible.1/ Take current pressure altitude2/ Convert it to ambient pressure (below, replacing p0 with baro setting would return the correct ambient pressure, but again sensor.pressure doesn't give exactly baro setting).3/ Convert that to depth`// Physics for ambient pressure calculation var p0 = 101325;// sea level standard atmospheric pressure Pa var L = 0.0065;// temperature lapse rate, = g/cp*for dry air K/m var T0 = 288.15;// sea level standard temperature 288,15 K var g = 9.80665;// Earth-surface gravitational acceleration 9,80665 m/s² var M = 0.0289644;// molar mass of dry air 0,0289644 kg/mol var R = 8.31447;// universal gas constant 8,31447 J/(mol*K) var exp = g*M/R/L; var fact = L/T0; var press = p0 * Math.pow((1-altitude*fact),exp)/100; var depth = 0.0; depth = (press/1000.0 - 1); if (unitElevMeters){ altStr = "-" + depth.format("%.2f") + "m"; } else {//feet altStr = "-" + (depth*3.28084).format("%1f") + "ft"; } ` Don't know if it helps but I hope so.

No not forgotten. :) Work is still ongoing, but it's going to take some time. I apologize that it's not being completed more quickly. It's not a simple matter of flipping a switch to make the data available--we're coordinating with a couple of other technology teams to come up with the best solution, and that will likely require us to also coordinate with device teams to integrate any necessary changes.

@julienvn: thanks for the formula this may be very helpful. But to be honest i have some troubles to use it. Technical it is not an issue but why should i make all strange calculation to recalculate the original data? I am an engineer that has the motivation to make an app for garmin to make their prduct better for free. It take a lot of my time to do this but how is the support to me in this case? I don't understand it is now 2 months later and still no response again. @brandon: please correct me if i see things the wrong way ��. I would be happy to admit that i am wrong in this case.

Hi there,I had the same issue as Fruitmans and posted the same question on another thread (https://forums.garmin.com/forum/developers/connect-iq/159801-) However, as it seems there is still no solution to that. Is there any chance that the ambient pressure sensor reading is going to be directly available? It seems kind of odd that only processed pressure data is available through the API even though there exists a datafield for this data.Maybe Brandon can give us an update on that after two years? Are there any plans to make this available through CIQ?Thanks for an update

4. Toybox.SensorHistory
   URL: https://developer.garmin.com/connect-iq/api-docs/Toybox/SensorHistory.html
   Toybox.SensorHistory

# Module: Toybox.SensorHistory

## Overview

The SensorHistory module contains the interface for SensorHistory.

SensorHistory provides access to historical information recorded by the on-board sensors of device hardware. The amount of information that is available is device dependent. This means that one device may provide more information than another. This class provides an ORDER_* enum which is used to select the data order of the sample iterator.

## Classes Under Namespace

Classes: SensorHistoryIterator, SensorSample

## Constant Summary

### Order

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| ORDER_NEWEST_FIRST | 0 | API Level 2.1.0 | Request iterator with newest data first |
| ORDER_OLDEST_FIRST | 1 | API Level 2.1.0 | Request iterator with oldest data first |

## Instance Method Summary collapse

getBodyBatteryHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order} or Null) as SensorHistory.SensorHistoryIterator

Get the body battery history for the given period.

getElevationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order} or Null) as SensorHistory.SensorHistoryIterator

Get the elevation history for the given period, up to the last power cycle.

getHeartRateHistory(options as { :period as Lang.Number or Time.Duration, :order as SensorHistory.Order or Null } or Null) as SensorHistory.SensorHistoryIterator

Get the heart rate history for the given period, up to the last power cycle.

getOxygenSaturationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order} or Null) as SensorHistory.SensorHistoryIterator

Get the oxygen saturation history for the given period This function always returns the most recent sensor history samples.

getPressureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order} or Null) as SensorHistory.SensorHistoryIterator

Get the pressure history for the given period, up to the last power cycle.

getStressHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order} or Null) as SensorHistory.SensorHistoryIterator

Get stress history data for the given period This function always returns the most recent sensor history samples.

getTemperatureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order} or Null) as SensorHistory.SensorHistoryIterator

Get the temperature history for the given period, up to the last power cycle.

## Instance Method Details

### getBodyBatteryHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator

Get the body battery history for the given period.

This function always returns the most recent sensor history samples. The time between each `SensorSample` in the iterator may be device dependent.

### getElevationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator

Get the elevation history for the given period, up to the last power cycle.

This function always returns the most recent pressure samples. The time between each SensorSample in the iterator may be device dependent.

### getHeartRateHistory(options as { :period as Lang.Number or Time.Duration, :order as SensorHistory.Order or Null } or Null) as SensorHistory.SensorHistoryIterator

Get the heart rate history for the given period, up to the last power cycle.

This function always returns the most recent heart rate samples. The time between each SensorSample in the iterator may be device dependent.

### getOxygenSaturationHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator

Get the oxygen saturation history for the given period

This function always returns the most recent sensor history samples. The time between each `SensorSample` in the iterator may be device dependent.

### getPressureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator

Get the pressure history for the given period, up to the last power cycle.

This function always returns the most recent pressure samples. The time between each SensorSample in the iterator may be device dependent.

### getStressHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator

Get stress history data for the given period

This function always returns the most recent sensor history samples. The time between each `SensorSample` in the iterator may be device dependent.

### getTemperatureHistory(options as { :period as Lang.Number or Time.Duration or Null, :order as SensorHistory.Order } or Null) as SensorHistory.SensorHistoryIterator

Get the temperature history for the given period, up to the last power cycle.

This function always returns the most recent temperature samples. The time between each SensorSample in the iterator may be device dependent.

---

Generated Jun 8, 2026, 3:42:17 PM

5. Ambient pressure and pressure history don't match - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/244746/ambient-pressure-and-pressure-history-don-t-match
   Ambient pressure and pressure history don't match - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 24 replies
- Subscribers 18 subscribers
- Views 5648 views
- Users 0 members are here

Options

Related

# Ambient pressure and pressure history don't match

Hey all, does anyone know what pressure the pressure history is storing? I have tested with putting both on screen and my ambient pressure is always higher than my max pressure history (over last 30 mins) so what is this doing?

If I look at my watch now it shows PH getMax to be 101833 and my AP now to be 102996. The PH never been above 101... if I put it in water (20cm) the AP goes up to 104888 which shows AP sensor is moving but PH never changes or goes near it.

Any insights would be great as I am trying to see historical pressure history to make a "guess" on no fly time for diving.

Many thanks,

Ben

- Sign in to reply
- Cancel

I'm not sure how SH.getPressureHistory deals with being under water. If I recall it's MSL pressure. Also, how often it's saved likely varies by device, where you can find the interval by comparing "when" in two adjacent samples.

And getting Sensor.Info.pressure can vary from what you see in Activity.Info.ambientPressure/Activity.Info.rawAmbientPressure

Ahh fiddle sticks... MSL pressure is of no use to me and that explains why it doesn't seem to change in the history even when submerged in water for 10 minutes. Must also be adjusting for depth of water (as this is the MK2 so has a depth sensor but cannot access it through CIQ I don't think?)

Basically, doesn't look like I can do what I want so will have to use the standard Garmin faces when diving and custom one when not :(

Thanks for the info Jim, appreciate it!

Actually stupid question, could I not just get raw and store date and time in a variable and do it that way..? The code doesn't reset each refresh does it? That would work I think :)

Actually that won't work as the WF has to be active to measure anything which it won't during a dive.

Also, Jim, does the memory/variables reset when you navigate away from the WF and back to it do you know? Thanks again.

Yes, you can build your own list of data and time. You might be able to do it in the main app, but you can also use a background service to take a reading every X minutes. In either case, you'll want to store the data using Application.Storage. You have to handle missing data.

I just saw your new post, but with a background process you can probably run the background while doing a dive.

Interesting, will look into that. Don't want to lag or run battery down for this so will see what performance is like on it :)

Thanks again for the info! :)

Here's a widget I did that does a graph of temperature using a background process. In general, the way it works is I save up to 96 samples with a time stamp. For a 4hr graph, the background runs every 4 minutes, but for a 48hr graph, every 30 minutes. Try it on your next dive. For missing readings, you'll see a pink mark under the graph.

The background in this is actually pretty minor, with the heavy lifting done in the widget itself.

Great, thanks. Will have a look at running background processes and see if that can work. Out of curiosity, why wouldn't you use temperature history for this or was it more of an experiment to see if it worked? (also this is a default widget isn't it or did you make it before that became standard?)

Thanks again Jim, you seem to be the fountain of knowledge on these forums because the Garmin library docs are terrible! :) hehe

SH.getTemperatureHistory only provides about 4hrs of data, and I wanted to allow for a couple days of data, so I did my own caching. And this doesn't require the widget itself to be run on a regular basis.

Ah of course, mine does say last 4 hours to be fair. Cool, will give this a go :)

Found a blog post you referenced 3 years ago but it is broken :( I cannot find any examples but is it a case of using a registerForTemporalEvent and setting it every say 10 minutes and then adding data to the Application.Storage? That how this would work? Sorry for all the Q's but I work better off examples and cannot find any I understand and this monkey C is pretty new to me

Thanks again

6. Toybox.Activity.Info vs. on Device Pressure - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/262285/toybox-activity-info-vs-on-device-pressure
   Toybox.Activity.Info vs. on Device Pressure - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- State Verified Answer
- Replies 3 replies
- Subscribers 17 subscribers
- Views 999 views
- Users 0 members are here

Options

Related

# Toybox.Activity.Info vs. on Device Pressure

Apologies if this is a common topic - couldn't find anything recent.

I've implemented pressure readings on my watch faces, but I am running into something I can't quite figure out. None of the available pressures in CIQ (ambientPressure, rawAmbientPressure, nor meanSeaLevelPressure) from Toybox.Activity.Info match the on-device pressure widget.

Does anyone know why this may be the case, and if so, how I can match the pressure readings up? Am I using the wrong variable, or is there some other issue? Some users are confused, and I am as well!

- Sign in to reply
- Cancel

## Top Replies

- Have you looked at SensorHistory.getPressureHistory(). The newest sample? You can also look in Sensor.Info, but with a watch face you can only do that in a background service.

## All Replies

Have you looked at SensorHistory.getPressureHistory(). The newest sample? You can also look in Sensor.Info, but with a watch face you can only do that in a background service.

Good idea - I have not. I'll give that a try tonight and see if it gives results more in line with the widget!

Yep, looks like that pulls the expected data. Thanks!

7. Freediving Depth Data Field - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/4028/freediving-depth-data-field
   Freediving Depth Data Field - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 12 replies
- Subscribers 19 subscribers
- Views 5216 views
- Users 0 members are here

Options

Related

# Freediving Depth Data Field

Recently I noticed that the very useful freediving data field called "Depth" has disappeared from the Connect IQ Store. I have no Idea why and I also don't remember the author of this data field. Because I need this data field and because I want to be able to record the data, I now try to code it myself. Only problem is that I currently run into some difficulties: -There seems to be no way to get the pressure reading from the barometer into a data field, because it would use the Sensor module which is not allowed to be used for a data field, only for an app (Gives error when put in manifest file). -And taken that it could be done anyhow, it most likely could not be done with Info.pressure because according to the API documentation this would return a pressure value corrected with the current altitude, whereas I would need the raw value to calculate the diving depth. So, my big question is: How did the author of this freediving depth data field achieve this?? Can anybody give me a hint with this? PS: Yes, I know that there exists a diving computer app at www.diveiq.com. But it’s quite expensive and not ideal for freediving. What I really want is just a data field to show me the current depth, which creates a FIT-File to show the depth as a graph in Garmin Connect.

- Sign in to reply
- Cancel

## Top Replies

- Don't confuse the water rating (how deep you can take the watch) with what pressures you can read with the watch. If I recall, some devices max out pressure readings at a depth that would work for…

## All Replies

You may want to check this sticky thread, as this is why the DF is now gone. https://forums.garmin.com/showthread.php?362498-Diving-related-Apps

> You may want to check this sticky thread, as this is why the DF is now gone. https://forums.garmin.com/showthread.php?362498-Diving-related-Apps

First thanks a lot for the quick answer. I was already expecting something like this. Honestly I think that’s a really bad decision made by Garmin here. Isn’t it each user’s own responsibility whether he wants to risk damaging his watch or not? I mean he bought it didn’t he? Ok. I see the point, that Garmin does not want to get sued, by users who “accidentally” destroyed their watch while using a diving app, but is banning all the diving apps really the way to go? Wouldn’t it be enough to make it mandatory to display a big fat red warning message when installing diving apps, which the user has to confirm? Then it would be 100% his own fault, if he broke his watch. This being said, could anybody help me with my coding related questions?

You might be able to use the altitude value provided inside the Activity.Info. If you go to 5m below the surface, the altimeter will show A. At 10m, it might show B... If you take measurements at various depths, you can establish a function that takes the altitude returned by the device and converts it to a depth. It would take a lot of testing to verify the correctness, but it seems that it might be a reasonable approach.Of course you could always try go contact the author of that original data field, and find out how he did it. Given that his data field was removed from the app store, he's probably going to be willing to share the source code with those that are interested.Travis

Depends on which watch you're developing for. For fenix 5 you can read raw pressure. I built exactly this data field today. Pop me a pm if you're interested. Cheers

Hi Niall,

I'm interested in this data field.

Can you help me, please? Thanks

Hi, have you had any luck?

Hi Marphy43

I know that it is now 5 years since you asked this question.

But I accidently saw your question just now. I were the author of the Depth gauge and the Max Depth gauge datafields that were on Connect IQ for a while.

The data fields were intended for use for fun when freediving etc.

I originally made it for Fenix3 and it were compatible with a few more devices. As I recall it, they were active for about a year and there were more than 3000 downloads and a lot of great reviews and no complaints.

I were working on other datafields for freediving like eg. surface time, time of last dive etc.

But, then one day I received a email from Garmin, stating that the Fenix3 and other compatible devices were never supposed to be used as a watch for diving and that the datafields were now removed from connect IQ.

It even stopped working on my own watch :-)

So yeah I spend time and effort on something that were loved and used by a lot of users, but it ended up being banned.

I used data from the altimeter to measure the depth. I wrote in an old thread how I did it here: https://forums.garmin.com/developer/connect-iq/f/app-ideas/974/freediving-depth-meter-surf-time

That's really sad, to hear.I was Hopping to Cross load this feature to the Instinct 2.0...It shows just how much Garmin tries too squeeze every Cent of its End User which Software Upgradeable Features that could and should be Free on a +400€ Watch...Want a Diving Feature? Nah, just buy another Watch for 800€...Want VO2Max? We could Software add it but nah, New Model for additional 400€while Dropping the Worth of your 2-Year-Old Watch by 60% without warning...I would say its about Time to Create an Open Source Rugged Smartwatch alternative that's Freely Configurable to your Needs.Will be Interesting to see, how long till this comment gets Taken down...Sorry for the Rant

You want to check out the App Approval Exceptions: https://forums.garmin.com/developer/connect-iq/w/wiki/10/app-approval-exceptions

Extreme Sports

Apps designed for scuba diving, free diving, skydiving, base-jumping, and extreme flight sports will not be listed on the app store for the following reasons:

- The diving features available on the Descent Mk1 are the only Garmin features intended for underwater diving use.
- The altimeter/barometer feature available in some Garmin devices is intended to be used for general altitude reference only, and is not intended to be used for extreme sports such as skydiving, base-jumping or other activities that require the use of equipment that is designed and intended for such use. The Jumpmaster feature on the Garmin tactix Bravo watch is intended to be used for skydiving activities by experienced skydivers. This is the only Garmin feature that is intended for use while skydiving.

Thanks for your Answer,About "[...] or other activities that require the use of equipment that is designed and intended for such use."the Instinct Tactic Series has also an Base Jumping Activity.And I doubt that the Barometric Sensor differs across the Series.The Instinct is Rated for 10 Bar, so technically a depth of 100m.Normal Scuba Diving goes to ~30m, 50-60m at max. so the Specification would suffice.For Apnoe it's Technically Possible, but i doubt that even a dwindling Minority can surpass a depth of 50 m.I know that for Scuba Diving Watches of 20 Bar are recommended as minimum Requirement.So technically this is right. But you could Inform the User about that and let him Accept an Agreement, like with the aviation-specific apps if thats a Problem.Like "Not Intended for Usage as Reference, only for Data Recording additionally the Watch is not Intended to be Used for this Use Case" Your Answer got my Hope up, that it might be Possible to get that App from other Sources, if you know what you are doing?Because it Technically says "will not be listed" not that its not allowed...Assumed Cross Loading is Possible.Could you Point me in such Direction?Or could you @Miguel_Hermann post it even on a Github Repo, so not everyone has to Recode it himself?

8. Toybox.Sensor
   URL: https://developer.garmin.com/connect-iq/api-docs/Toybox/Sensor.html
   Toybox.Sensor

# Module: Toybox.Sensor

## Overview

The Sensor module provides access to sensor data.

Sensor allows Apps to register for updates to the current sensor data. It also enables apps to control the ANT+ sensors supported natively by the device, which are described by the provided SENSOR_* constants.

## Classes Under Namespace

## Constant Summary

### RemoteSensorType

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| SENSOR_BIKESPEED | 0 | API Level 1.0.0 | |
| SENSOR_BIKECADENCE | 1 | API Level 1.0.0 | |
| SENSOR_BIKEPOWER | 2 | API Level 1.0.0 | |
| SENSOR_FOOTPOD | 3 | API Level 1.0.0 | |
| SENSOR_HEARTRATE | 4 | API Level 1.0.0 | |
| SENSOR_TEMPERATURE | 5 | API Level 1.0.0 | |
| SENSOR_GENERIC | 9 | API Level 5.1.0 | |

### OnboardSensorType

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| SENSOR_PULSE_OXIMETRY | 6 | API Level 3.2.0 | |
| SENSOR_ONBOARD_PULSE_OXIMETRY | 7 | API Level 3.2.0 | |
| SENSOR_ONBOARD_HEARTRATE | 8 | API Level 3.2.0 | |

### SensorTechnology

The sensor technology

Describes the technology used to communicate with the sensor.

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| SENSOR_TECHNOLOGY_ANT | 0 | API Level 3.2.0 | ANT Sensor |
| SENSOR_TECHNOLOGY_BLE | 1 | API Level 3.2.0 | Bluetooth Low Energy Sensor |
| SENSOR_TECHNOLOGY_ONBOARD | 2 | API Level 3.2.0 | Onboard Sensor |

## Typedef Summary collapse

- SensorType as Sensor.RemoteSensorType or Sensor.OnboardSensorType

## Instance Method Summary collapse

disableSensorType(sensorType as Sensor.SensorType) as Lang.Boolean

Disable the given sensor type for use.

enableSensorEvents(listener as Null or Lang.Method(info as Sensor.Info) as Void) as Void

Request sensor events from enabled sensors.

enableSensorType(sensorType as Sensor.SensorType) as Lang.Boolean

Enable the given sensor type for use.

getInfo() as Sensor.Info

Get the current Sensor Sensor.Info.

getMaxSampleRate() as Lang.Number

Get the maximum sample rate supported by the system.

getMaxSampleRateForSensorType(sensorDataType as Lang.Symbol) as Lang.Number

Get the maximum sample rate supported for given sensor data type.

getRegisteredSensors(sensorType as Sensor.SensorType or Null) as Sensor.SensorInfoIterator

Retrieve the sensors that are currently registered.

notifyError(string as Lang.String or Null) as Void

Let the system know the app has encountered an error.

notifyNewSensor(sensor as Sensor.SensorInfo, configurationRequired as Lang.Boolean) as Void

Let the system know the app has discovered a new sensor.

notifyPairComplete(sensor as Sensor.SensorInfo) as Void

Let the system know the app has finished pairing a sensor.

notifyScanComplete() as Void

Let the system know the app has finished scanning for sensors.

notifyUnpairComplete(sensor as Sensor.SensorInfo) as Void

Let the system know the app has finished unpairing a sensor.

registerSensorDataListener(listener as Lang.Method(data as Sensor.SensorData) as Void, options as { :period as Lang.Number, :accelerometer as { :enabled as Lang.Boolean, :sampleRate as Lang.Number, :includePower as Lang.Boolean, :includePitch as Lang.Boolean, :includeRoll as Lang.Boolean, :includeTimestamps as Lang.Boolean}, :gyroscope as { :enabled as Lang.Boolean, :sampleRate as Lang.Number, :includeTimestamps as Lang.Boolean}, :magnetometer as { :enabled as Lang.Boolean, :sampleRate as Lang.Number, :includeTimestamps as Lang.Boolean}, :heartBeatIntervals as { :enabled as Lang.Boolean}, :synchronous as Lang.Boolean}) as Void

Register a callback to fetch high-frequency data from various sensors.

setEnabledSensors(sensors as Lang.Array< Sensor.SensorType>) as Lang.Array< Sensor.SensorType>

Enable sensors for use.

unregisterSensorDataListener() as Void

Unregister a previously registered data listener.

## Typedef Details

### SensorType as Sensor.RemoteSensorType or Sensor.OnboardSensorType

## Instance Method Details

### disableSensorType(sensorType as Sensor.SensorType) as Lang.Boolean

Disable the given sensor type for use.

Unlike the existing setEnabledSensors() function, this will not enable/disable other sensor types.

Note:

Will cause an app crash if called from a data field app

### enableSensorEvents(listener as Null or Lang.Method(info as Sensor.Info) as Void) as Void

Request sensor events from enabled sensors.

Sensor events are retrieved from any enabled sensors at a rate of 1 Hz. The data retrieved from enabled sensors is passed to the listener Method provided as a parameter to this method.

Note:

Will cause an app crash if called from a data field app

### enableSensorType(sensorType as Sensor.SensorType) as Lang.Boolean

Enable the given sensor type for use.

Unlike the existing setEnabledSensors() function, this will not enable/disable other sensor types.

Note:

Will cause an app crash if called from a data field app

Note:

Multitasking: Sensor states can not be changed while in inacitve mode and sensor enabled during active mode will be disabled when app becomes inactive, and re-enabled automatically when is active again. These state changes are denoted by calls to AppBase.onActive() and AppBase.onInactive().

### getInfo() as Sensor.Info

Get the current Sensor Sensor.Info.

This is useful for retrieving the current sensor info either on demand or periodically within a Timer.

Note:

Will cause an app crash if called from a data field app

### getMaxSampleRate() as Lang.Number

Get the maximum sample rate supported by the system.

Note:

Will cause an app crash if called from a data field app

Note:

This function can produce different results after the app transitions to the active state after being inactive. These state changes are denoted by calls to AppBase.onActive() and AppBase.onInactive().

### getMaxSampleRateForSensorType(sensorDataType as Lang.Symbol) as Lang.Number

Get the maximum sample rate supported for given sensor data type.

Note:

Will cause an app crash if called from a data field app

Note:

This function can produce different results after the app transitions to the active state after being inactive. These state changes are denoted by calls to AppBase.onActive() and AppBase.onInactive().

### getRegisteredSensors(sensorType as Sensor.SensorType or Null) as Sensor.SensorInfoIterator

Retrieve the sensors that are currently registered.

This function returns an iterator for the sensors that are considered to be `registered` if pairing information has been provided for it in Sensor settings.

### notifyError(string as Lang.String or Null) as Void

Let the system know the app has encountered an error

### notifyNewSensor(sensor as Sensor.SensorInfo, configurationRequired as Lang.Boolean) as Void

Let the system know the app has discovered a new sensor

### notifyPairComplete(sensor as Sensor.SensorInfo) as Void

Let the system know the app has finished pairing a sensor

### notifyScanComplete() as Void

Let the system know the app has finished scanning for sensors

### notifyUnpairComplete(sensor as Sensor.SensorInfo) as Void

Let the system know the app has finished unpairing a sensor

### registerSensorDataListener(listener as Lang.Method(data as Sensor.SensorData) as Void, options as { :period as Lang.Number, :accelerometer as { :enabled as Lang.Boolean, :sampleRate as Lang.Number, :includePower as Lang.Boolean, :includePitch as Lang.Boolean, :includeRoll as Lang.Boolean, :includeTimestamps as Lang.Boolean }, :gyroscope as { :enabled as Lang.Boolean, :sampleRate as Lang.Number, :includeTimestamps as Lang.Boolean }, :magnetometer as { :enabled as Lang.Boolean, :sampleRate as Lang.Number, :includeTimestamps as Lang.Boolean }, :heartBeatIntervals as { :enabled as Lang.Boolean }, :synchronous as Lang.Boolean }) as Void

Register a callback to fetch high-frequency data from various sensors.

The callback will get invoked each time a new set of sensor data over the length of time specified in the period option is available.

Note:

Only one data request is allowed to be registered at a time. Subsequent calls to this function for the same sensor type will override previously registered requests.

Note:

Magnetometer data is not supported in synchronous data request.

Note:

Will cause an app crash if called from a data field app

### setEnabledSensors(sensors as Lang.Array<Sensor.SensorType>) as Lang.Array<Sensor.SensorType>

Enable sensors for use.

This will enable both connected ANT+ sensors and system sensors if possible.

Note:

Will cause an app crash if called from a data field app

Note:

Multitasking: Sensor states can not be changed while in inacitve mode and sensor enabled during active mode will be disabled when app becomes inactive, and re-enabled automatically when is active again. These state changes are denoted by calls to AppBase.onActive() and AppBase.onInactive().

### unregisterSensorDataListener() as Void

Unregister a previously registered data listener.

Note:

Will cause an app crash if called from a data field app

---

Generated Jun 8, 2026, 3:42:17 PM

Toybox.Sensor.Info

Toybox.SensorHistory

Toybox.Sensor