Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/tildagon-apps/reference/badge-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,18 @@ __app_export__ = ExampleApp

### Methods

The api currently only allows access to the raw data.
In order to support alternative imu devices a base set of functionality is provided along with i2c access to the device for apps to add functinality. An identify function is provided to determine which device is on the badge. Only the prototype badges have a different imu, but this may change in the future.

<!-- prettier-ignore -->
| Method | Description | Arguments | Returns |
| ------ | ----------- | --------- | ------- |
| `acc_read()` | Get the accelerometer data. | None | `(x,y,z)`: The accelerometer data as a tuple of floats (m/s^2). |
| `gyro_read()` | Get the gyro data. | None | `(x,y,z)`: The gyro data as a tuple of floats (d/s). |
| `step_counter_read()` | Get the step count | None | `count`: The step count |
| `temperature_read()` | Get the temperature | None | `temerature`: Temperature (°).|
| `id()` | Get the device id | None | `id`: string id of device. |
| `readfrom()` | Read from a device register| `(register address, length)`: address to start read from, length of read | `data`: bytes of the data or -ve error code. |
| `writeto()` | Write data to a device register | `(register address, bytes)`: address to start write to, data.| `error`: or None if ok. |

### Usage

Expand Down