evothings.tisensortag. SensorTagInstanceBLE_CC2541
Source: evothings-libraries/
SensorTag CC2541 instance object.
Property
Methods
Property
deviceModel
The device model.
Methods
accelerometerCallback(fun, interval)
Public. Set the accelerometer notification callback.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
fun |
|
|
success callback called repeatedly: fun(data) |
interval |
|
|
accelerometer rate in milliseconds. |
accelerometerOff()
SensorTag CC2541. Public. Turn off accelerometer notification.
accelerometerOn()
SensorTag CC2541. Public. Turn on accelerometer notification.
barometerOn()
SensorTag CC2541. Public. Turn on barometer notification.
deviceIsSensorTag()
Determine if a BLE device is a SensorTag CC2541. Checks for the CC2541 using the advertised name.
getAccelerometerValues(data)
SensorTag CC2541. Calculate accelerometer values from raw data.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
data |
|
|
an Uint8Array. |
- Returns
-
Object with fields: x, y, z.
getBarometerValues()
SensorTag CC2541. Calculate barometer values from raw data.
getGyroscopeValues(data)
SensorTag CC2541. Calculate gyroscope values from raw data.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
data |
|
|
an Uint8Array. |
- Returns
-
Object with fields: x, y, z.
getMagnetometerValues(data)
SensorTag CC2541. Calculate magnetometer values from raw data.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
data |
|
|
an Uint8Array. |
- Returns
-
Object with fields: x, y, z.
getTemperatureValues(data)
Calculate temperature values from raw data.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
data |
|
|
an Uint8Array. |
- Returns
-
Object with fields: ambientTemperature, targetTemperature.
gyroscopeCallback(fun, interval, axes)
Public. Set the gyroscope notification callback.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
fun |
|
|
success callback called repeatedly: fun(data) |
interval |
|
|
gyroscope rate in milliseconds. |
axes |
|
|
the axes to enable ((z << 2) | (y << 1) | x) Axis parameter values are: 1 = X only, 2 = Y only, 3 = X and Y, 4 = Z only, 5 = X and Z, 6 = Y and Z, 7 = X, Y and Z. |
gyroscopeOff()
Public. Turn off gyroscope notification (SensorTag CC2541).
gyroscopeOn()
SensorTag CC2541. Public. Turn on gyroscope notification.
isAccelerometerAvailable()
Public. Checks if the accelerometer sensor is available.
isBarometerAvailable()
Public. Checks if the barometer sensor is available.
isGyroscopeAvailable()
Public. Checks if the gyroscope sensor is available.
isHumidityAvailable()
Public. Checks if the humidity sensor is available.
isKeypressAvailable()
Public. Checks if the keypress sensor is available.
isMagnetometerAvailable()
Public. Checks if the magnetometer sensor is available.
isTemperatureAvailable()
Public. Checks if the Temperature sensor is available.
magnetometerCallback(fun, interval)
Public. Set the magnetometer notification callback.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
fun |
|
|
success callback called repeatedly: fun(data) |
interval |
|
|
magnetometer rate in milliseconds. |
magnetometerOff()
Public. Turn off magnetometer notification (SensorTag CC2541).
magnetometerOn()
Public. Turn on magnetometer notification (SensorTag CC2541).