View Source PiGlow

Hex.pm Version

PiGlow is a library for controlling a Pimoroni "PiGlow" LED array.

With it, you can turn the LEDs on or off, and adjust their power output, allowing your Elixir daemon to give some fun visual feedback to the world around it.

installation

Installation

PiGlow requires Elixir v1.14. To use it, add :pi_glow to your list of dependencies in mix.exs:

def deps do
  [
    {:pi_glow, "~> 0.1.0"}
  ]
end

usage

Usage

# Set all LEDs to full power, but turned off:
PiGlow.map_enable_and_power(fn _ -> {false, 255} end)

# Turn on each arm in sequence:
1..3
|> Enum.each(fn arm ->
  PiGlow.map_enable(fn led -> led.arm == arm end)
  Process.sleep(1000)
end)

# Turn everything off:
PiGlow.map_enable_and_power(fn _ -> {false, 0} end)
# Wait before exiting:
PiGlow.wait()

More examples can be found in the examples directory.

documentation

Documentation

Full documentation can be found at https://hexdocs.pm/pi_glow.

Copyright © 2023, Adrian Irving-Beer.

PiGlow is released under the MIT license and is provided with no warranty. I doubt it's possible to damage your PiGlow with this library, but if you do, I'm not responsible.