-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,11 @@ name = "idasen" | |
version = "0.1.0" | ||
authors = ["Andrzej Klajnert <[email protected]>"] | ||
edition = "2018" | ||
license = "MIT" | ||
description = "Crate to control IDASEN standing desk from IKEA via Bluetooth." | ||
homepage = "https://github.com/aklajnert/idasen" | ||
repository = "https://github.com/aklajnert/idasen" | ||
readme = "README.md" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Idasen | ||
|
||
Crate to control IDASEN standing desk from IKEA via Bluetooth. | ||
|
||
## Usage | ||
|
||
```rust | ||
use idasen::Idasen; | ||
|
||
// instantiate the struct, this will attempt to connect to the desk and discover its characteristics | ||
let desk = Idasen::new()?; | ||
|
||
// alternatively, if there's more than one desk you can get the correct one by it's mac addres | ||
// let desk = Idasen::by_addr("EC:86:F6:44:D3:31")?; | ||
|
||
// move desk up and down | ||
desk.up(); | ||
desk.down(); | ||
|
||
// stop desk from moving | ||
desk.stop(); | ||
|
||
// move desk to desired position - minimum: 6200 (62cm), maximum: 12700 (1.27m) | ||
desk.move_to(7400); | ||
|
||
// get the position as an integer (10 = 1mm) | ||
println!("Position: {}", desk.position()?); | ||
``` |