-
Notifications
You must be signed in to change notification settings - Fork 52
Messages
Metawear edited this page Jul 7, 2015
·
1 revision
The Message class encapsulates all types of sensor data in a generic container. Data from different sensors are interpreted differently so users will need to be conscious of what type they are requesting their data be converted to. Available message types are outlined in the below table.
Message Type | Description |
---|---|
GpioAbsRefMessage | GPIO analog input data as an absolute reference value |
GpioAdcMessage | GPIO analog input data as an ADC ratio |
GpioDigitalMessage | GPIO digital input data |
MwrAccelAxisMessage | XYZ axis data from the MetaWearR accelerometer separated into individual axis values |
MwrAccelCombinedAxisMessage | XYZ axis data from the MetaWearR accelerometer combined into 1 value |
SwitchMessage | Data from switch state changes |
Temperature | Data from a temperature sensor |
All messages can be interpreted as a byte, short, integer, or long. For some sensors, these primitive types do not provide a meaningful interpretation of the data and require a different interpretation. The following sections will cover what the data will look like if you call Message.getData with specific type classes.
Type | Description |
---|---|
Short.class | Interprets GPIO analog input data in units of mV |
Float.class | Interprets GPIO analog input data in units of V |
Type | Description |
---|---|
Short.class | Interprets the ADC data as a short |
Type | Description |
---|---|
AxisG.class | Interpret the XYZ axis data in units of Gs |
AxisMilliG.class | Interpret the XYZ axis data in units of milliGs |
Type | Description |
---|---|
Float.class | Interpret the combined data in units of Gs |
Short.class | Interpret the combined data in units of milliGs |
Type | Description |
---|---|
Boolean.class | True if pressed, false if released |
Byte.class | 1 if pressed, 0 if released |
Type | Description |
---|---|
Float.class | Interprets the temperature as degrees Celsius. |