|
|
|
# Usage — Linux-GPIO
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Any accessed GPIO device need at least read permission (which is enough even
|
|
|
|
for writing). Typically, only the root user has access, hence permissions need
|
|
|
|
to be set. For instance, for device 0 on a Raspberry Pi (user `pi`) :
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ chown root:pi /dev/gpiochip0
|
|
|
|
$ chmod g+r /dev/gpiochip0
|
|
|
|
```
|
|
|
|
|
|
|
|
The [javadoc](https://javadoc.io/doc/io.helins/linux-gpio) provide all details.
|
|
|
|
|
|
|
|
Have a look at the [examples](../tree/masterexamples).
|
|
|
|
|
|
|
|
Run an example where `$EXAMPLE` is the name of an example such as
|
|
|
|
`AlternatingLeds` :
|
|
|
|
```bash
|
|
|
|
$ ./gradlew :examples:$EXAMPLE:run
|
|
|
|
```
|
|
|
|
|
|
|
|
Run tests :
|
|
|
|
```bash
|
|
|
|
$ ./gradlew test
|
|
|
|
```
|
|
|
|
|
|
|
|
Run tests on the Raspberry Pi 3 (or similar), will test some IO :
|
|
|
|
```bash
|
|
|
|
$ ./gradlew test -DonRaspberry=true
|
|
|
|
``` |
|
|
\ No newline at end of file |