-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.jl.cov | ||
*.jl.*.cov | ||
*.jl.mem | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/ | ||
site/ | ||
src/examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Documenter | ||
using PiGPIO | ||
using Literate | ||
|
||
Literate.markdown(joinpath(@__DIR__, "..", "examples", "01_blink.jl"), joinpath(@__DIR__, "src", "examples")) | ||
Literate.markdown(joinpath(@__DIR__, "..", "examples", "02_blink_twice.jl"),joinpath(@__DIR__, "src", "examples")) | ||
Literate.markdown(joinpath(@__DIR__, "..", "examples", "03_rgb.jl"), joinpath(@__DIR__, "src", "examples")) | ||
|
||
makedocs( | ||
sitename = "PiGPIO", | ||
format = Documenter.HTML(), | ||
modules = [PiGPIO], | ||
pages = [ | ||
"index.md", | ||
"API Docs" => "api.md", | ||
"Examples" => [ | ||
"Blink Once" => "examples/01_blink.md", | ||
"Blink Twice" => "examples/02_blink_twice.md", | ||
"Red-Green-Blue" => "examples/03_rgb.md" | ||
] | ||
] | ||
) | ||
|
||
# Documenter can also automatically deploy documentation to gh-pages. | ||
# See "Hosting Documentation" and deploydocs() in the Documenter manual | ||
# for more information. | ||
#=deploydocs( | ||
repo = "<repository url>" | ||
)=# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# PiGPIO API | ||
|
||
```@index | ||
``` | ||
|
||
```@autodocs | ||
Modules = [PiGPIO] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# PiGPIO.jl | ||
|
||
Documentation for PiGPIO.jl | ||
|
||
### Control GPIO pins on the Raspberry Pi from Julia | ||
|
||
[![PiGPIO](https://img.youtube.com/vi/UmSQjkaATk8/0.jpg)](https://www.youtube.com/watch?v=UmSQjkaATk8) | ||
|
||
PiGPIO.jl is a Julia package for the Raspberry which communicates with the pigpio | ||
daemon to allow control of the general purpose | ||
input outputs (GPIO). | ||
|
||
This package is an effective translation of the python package for the same. | ||
Which can be found [here](http://abyz.me.uk/rpi/pigpio/python.html) | ||
|
||
## Features | ||
|
||
* OS independent. Only Julia 1.0+ required. | ||
* Controls one or more Pi's. | ||
* Hardware timed pulse width modulation. | ||
* Hardware timed servo pulse. | ||
* Callbacks when any of GPIO change state. | ||
* Create and transmit precise waveforms. | ||
* Read/Write GPIO and set their modes. | ||
* Wrappers for I2C, SPI, and serial links. | ||
|
||
Once a pigpio daemon is launched on the pi this package can connect to | ||
it and communicate with it to manipulate the GPIO pins of the pi. The actual | ||
work is done by the daemon. One benefit of working this way is that you can | ||
remotely access the pi over a network and multiple instances can be connected | ||
to the daemon simultaneously. | ||
|
||
Launching the daemon requires sudo privileges. Launch by typing `sudo pigpiod` | ||
in the terminal. | ||
|
||
## Installation and Usage | ||
|
||
```julia | ||
using Pkg | ||
Pkg.add("https://github.com/JuliaBerry/PiGPIO.jl") | ||
|
||
using PiGPIO | ||
|
||
pi=Pi() #connect to pigpiod daemon on localhost | ||
``` | ||
|
||
## Example Usage | ||
|
||
```julia | ||
set_mode(p::Pi, pin::Int, mode) | ||
get_mode(p::Pi, pin::Int) | ||
# mode can be INPUT or OUTPUT | ||
|
||
read(p, pin) | ||
write(p, pin, state) | ||
#state can be HIGH, LOW, ON, OFF | ||
|
||
set_PWM_dutycycle(p, pin, dutycyle) | ||
#dutycyle defaults to a range 0-255 | ||
``` |
9e31cbc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
9e31cbc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/1923
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via: