Skip to content

Commit

Permalink
Merge pull request #85 from emfcamp/add_imu
Browse files Browse the repository at this point in the history
add api and example with basic description
  • Loading branch information
ChrisDick authored Jun 1, 2024
2 parents 24c65af + 24708c8 commit f71ca40
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/tildagon-apps/widgets-and-hardware/badge-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,32 @@ To use the LEDs:
from tildagonos import tildagonos
```

2. TODO
2. TODO


## `IMU` overview

The IMU device is a highly integrated, low power inertial measurement unit (IMU) that combines precise acceleration and angular rate (gyroscopic) measurement. The triple axis device has been configured to measure 2g and 2 degree per second ranges.

```python
import imu

#read the data 1000 times
count = 0
while True:
count += 1
if count >= 1000:
break
accel = imu.acc_read()
print( f"accel x,y,z: %f, %f, %f", accel[0], accel[1], accel[2] )

```

## Methods

The api currently only allows access to the raw data.

| Method | Description | Arguments | Returns |
| ------ | ----------- | --------- | ------- |
| acc_read() | getter for the accelerometer data | None | x,y,z tuple of floats (m/s^2) |
| gyro_read() | getter for the gyro data| None | x,y,z tuple of floats (d/s) |

0 comments on commit f71ca40

Please sign in to comment.