1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49# keyleds.cr
A Crystal interface to the [`libkeyleds`](https://github.com/keyleds/keyleds) library.
[**API Documentation**](https://nickbclifford.github.io/keyleds.cr/)
## License
As a derived work of `keyleds`, these bindings are licensed under the GNU GPLv3.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
keyleds:
github: nickbclifford/keyleds.cr
```
2. Run `shards install`
## Usage
```crystal
require "keyleds"
APP_ID = 1_u8
Keyleds::Device.open("/dev/hidraw1", APP_ID) do |device|
puts device.name
device.set_led_block(:logo, red: 0, blue: 255, green: 0)
device.commit_leds
end
```
## Contributing
1. Fork it (<https://github.com/nickbclifford/keyleds.cr/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Nick Clifford](https://github.com/nickbclifford) - creator and maintainer