Skip to content

Commit

Permalink
Merge pull request #83 from archey347/main
Browse files Browse the repository at this point in the history
Add PatternDisable event call to example LED program
  • Loading branch information
npentrel authored Jun 1, 2024
2 parents 654bd14 + cc45da8 commit 5bbd13a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/tildagon-apps/widgets-and-hardware/badge-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ import app
from app_components import clear_background
from events.input import Buttons, BUTTON_TYPES
from tildagonos import tildagonos
from system.eventbus import eventbus
from system.patterndisplay.events import *

class LEDExampleApp(app.App):
def __init__(self):
self.button_states = Buttons(self)

# This disables the patterndisplay system module, which does the default colour spinny thing
eventbus.emit(PatternDisable())

def update(self, delta):
if self.button_states.get(BUTTON_TYPES["RIGHT"]):
tildagonos.leds[2] = (255, 0, 0)
Expand Down Expand Up @@ -256,9 +261,6 @@ To use the LEDs:
from tildagonos import tildagonos
```

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.
Expand Down Expand Up @@ -301,4 +303,4 @@ The api currently only allows access to the raw data.
| 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). |
| gyro_read() | Get the gyro data. | None | `(x,y,z)`: The gyro data as a tuple of floats (d/s). |

0 comments on commit 5bbd13a

Please sign in to comment.