Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasRoeddiger authored Oct 2, 2023
1 parent 68724c3 commit 07c3937
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,30 @@ This repository offers comprehensive web interface for controlling and monitorin

This repository also includes the [OpenEarable.js](https://github.com/OpenEarable/dashboard#openearablejs-library) JavaScript library in the `assets/js/OpenEarable.js` folder. This way, researchers and developers can easily integrate OpenEarable into their own workflows.

## Table of Contents
- Usage
- Overview
- Running the Server
- OpenEarable.js Library
- Installation
- Usage Examples
- Connect to OpenEarable
- Subscribe to Sensor Data
- Play Audio
- Control RGB LED
- Receive Button Events
- Receive Battery Events

## Usage

### Overview

### Running the server yourself
If you want to run the dashboard yourself and have python3 installed, you can use the following command to run the website from the root of this repository. This will start the webserver at `http://localhost:8000`.
```bash
python3 -m http.server
```

## OpenEarable.js Library
OpenEarable.js is a JavaScript library that provides a seamless interface to connect, manage, and interact with OpenEarable. The library abstracts the complexities of BLE communication, making it easy to fetch device details, manage sensors, LED, and audio, and subscribe to device state changes.

Expand All @@ -14,7 +36,7 @@ To use OpenEarable.js simply integrate the library found under `assets/js/OpenEa
<script src="./OpenEarable.js"></script>
```

### Usage Example
### Usage Examples
The following example shows how to use the OpenEarable library.

#### Connect to OpenEarable
Expand Down Expand Up @@ -70,6 +92,9 @@ openEarable.audioPlayer.jingle(AUDIO_STATE.PLAY, JINGLE.NOTIFICATION);
openEarable.rgbLed.writeLedColor(255, 0, 0);
```

#### Receive Button Events
TODO

#### Receive Battery Events
```js
openEarable.subscribeBatteryLevelChanged((batteryLevel) => {
Expand Down

0 comments on commit 07c3937

Please sign in to comment.