Use the GrovePi+ and sensors in Elixir on a Raspberry Pi. If you have a Beaglebone Green or other port that has direct access to sensors (rather than going through a GrovePi+), take a look at nerves_grove.
If available in Hex, the package can be installed
by adding grovepi
to your list of dependencies in mix.exs
:
def deps do
[{:grovepi, "~> 0.5.1"}]
end
The grovepi
library uses Elixir Circuits - I2C for I2C communication to the
GrovePi+. This only works on Raspberry Pi computers. If you're working on
another platform, a stub is available for debugging and testing. When building
grovepi
standalone, be aware that circuits_i2c
is only used for MIX_ENV=prod
builds. To use the stub in your own programs, add the following to your
configuration:
config :grovepi, :i2c, GrovePi.I2C
See the generated documentation at hexdocs.pm/grovepi.
We welcome contributions to tackle issues in GrovePi.
First fork the repository and fetch your own copy
mix deps.get
mix test
- Fork the repository.
- Create a topic branch.
- Add tests for your unimplemented feature or bug fix.
- Run
mix test
. If your tests pass, return to step 3. - Implement your feature or bug fix.
- Run
mix test
. If your tests fail, return to step 5. - Commit, and push your changes.
- Submit a pull request.
All tests can be run with mix test
or a single test file can be run
with mix test path/to/file_test.exs
.
If you would like tests to run in the background as you change files you
can run mix test.watch
.