An Erlang NIF for the WiringPi library for the Raspberry Pi
Erlang C
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit ahead, 36 commits behind klajo:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
c_src
include
src
.gitignore
README.md
rebar.config

README.md

wpi - an Erlang NIF for the WiringPi library for the Raspberry Pi

This application is an Erlang wrapper around the WiringPi library.

Getting started

Start by downloading and installing the WiringPi library.

Then it should be possible to build wpi using rebar.

rebar compile

Before starting, you need to include a hrl file which defines some useful constants (matches those of WiringPi):

-include_lib("wpi/include/wpi.hrl").

Then you can start setting up the pins and use them:

application:start(wpi),
Pin = 4,
wpi:pin_mode(Pin, ?WPI_OUTPUT),
wpi:digital_write(Pin, ?WPI_HIGH),

Caveats

This NIF is entirely experimental - use at your own risk. It has been used to both write to (LED) and read from (button) pins successfully, while some functionality may be untested.

Contributions

Contributions are more than welcome.

Credits

Credits go to Gordon Henderson for the WiringPi library.