Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 42d3dfc

Browse files
committed
README markdown and Elixir updates
1 parent 3ed1838 commit 42d3dfc

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

README.md

+17-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
Nerves.Leds
2-
===========
1+
# Nerves.Leds
2+
33
[![Build Status](https://travis-ci.org/nerves-project/nerves_leds.svg?branch=master)](https://travis-ci.org/nerves-project/nerves_leds)
4-
[![Hex version](https://img.shields.io/hexpm/v/nerves_leds.svg "Hex version")](https://hex.pm/packages/nerves_leds) [![Ebert](https://ebertapp.io/github/nerves-project/nerves_leds.svg)](https://ebertapp.io/github/nerves-project/nerves_leds)
4+
[![Hex version](https://img.shields.io/hexpm/v/nerves_leds.svg "Hex version")](https://hex.pm/packages/nerves_leds)
55

66
Simple API to drive leds exposed by linux `/sys/class/leds`. Designed for use with [Nerves](http://nerves-project.org/), but works on any distribution of Linux with `/sys/class/leds`.
77

88
## Installation
99

10-
If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:
11-
12-
1. Add `nerves_leds` to your list of dependencies in `mix.exs`:
13-
14-
```elixir
15-
def deps do
16-
[{:nerves_leds, "~> 0.8.0"}]
17-
end
18-
```
19-
20-
2. Run `mix deps.get` and `mix compile`
10+
Add `nerves_leds` to your list of dependencies in `mix.exs`:
2111

12+
```elixir
13+
def deps do
14+
[{:nerves_leds, "~> 0.8.0"}]
15+
end
16+
```
2217

23-
### Configuration & Usage
18+
## Configuration & Usage
2419

2520
Configure your LEDs mappings:
2621

@@ -34,27 +29,27 @@ Now, you can use predefined states in your app:
3429
```elixir
3530
alias Nerves.Leds
3631

37-
Leds.set connect: true
38-
Leds.set connect: :heartbeat
39-
Leds.set connect: false, error: :slowblink
32+
Leds.set(connect: true)
33+
Leds.set(connect: :heartbeat)
34+
Leds.set(connect: false, error: :slowblink)
4035
```
4136

4237
You can also define your own states:
4338

4439
```elixir
4540
# config/config.exs
4641
config :nerves_leds, states: [
47-
fastblink: [ trigger: "timer", delay_off: 40, delay_on: 30 ],
48-
blip: [ trigger: "timer", delay_off: 1000, delay_on: 100 ]]
42+
fastblink: [ trigger: "timer", delay_off: 40, delay_on: 30 ],
43+
blip: [ trigger: "timer", delay_off: 1000, delay_on: 100 ]]
4944
```
5045

5146
For situations where the number of LEDs are not known at compile time, you
5247
can enumerate the LEDs:
5348

5449
```elixir
55-
Leds.enumerate
50+
Leds.enumerate()
5651
```
5752

58-
### More Details
53+
## More Details
5954

6055
See the [documentation](https://hexdocs.pm/nerves_leds) for the full description of the API and configuration.

0 commit comments

Comments
 (0)