gpio
Version, currently 1.1.25 versions
- 1.1.3latestJan 6, 2025
- 1.1.2not indexedJan 8, 2025
- 1.1.1not indexedJan 8, 2025
- 1.1.0not indexedJan 8, 2025
- 1.0.0not indexedJan 8, 2025
github.com/spider-gazelle/gpio.cr
crystal lang bindings for linux gpiod
Nothing has been indexed for 1.1.2 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
gpio:
github: spider-gazelle/gpio.cr
version: ~> 1.1.2Then run:
shards installshard.yml
No shard.yml has been indexed for 1.1.2. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
gpio
bindings for linux gpiod, a user space interface for general purpose IO control
Installation
ensure the development dependencies are installed: sudo apt install libgpiod-dev
-
Add the dependency to your
shard.yml:dependencies: gpio: github: spider-gazelle/gpio.cr -
Run
shards install
Usage
You can list the various chips available on a system by running gpioinfo this will list chips and IO line details.
require "gpio"
GPIO.default_consumer = "my app"
all_chips = GPIO::Chip.all
# or if you know the name
chip = GPIO::Chip.new "gpiochip0"
chip.lines
# take control of a line and set it's state
line = chip.line(5)
line.name
line.request_output
line.set_high
line.high? # => true
sleep 0.5
line.set_low
line.high? # => false
# release the line once finished using
# this will also happen on garbage collection
line.release
You can also configure the line for input and wait for input events to occur
require "gpio"
GPIO.default_consumer = "my app"
chip = GPIO::Chip.new "gpiochip0"
line = chip.line 0
# blocks here until this line is released
# so you might want to do this in a spawn etc
line.on_input_change do |input_is|
case input_is
in .rising?
puts "input is high"
in .falling?
puts "input is low"
end
end
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.1.2- Tagged
- Jan 8, 2025
- Commit
bbfb2289aa3a- Indexed
- not yet
Dependents
Repository
github.com/spider-gazelle/gpio.cr
Metadata
- Created
- Aug 18, 2026
- Updated
- Sep 26, 2026
- Synced
- Sep 26, 2026
- Versions
- 5