Skip to content

Commit 9e31cbc

Browse files
committed
Add Documentation.
1 parent 44a9bdc commit 9e31cbc

File tree

7 files changed

+107
-0
lines changed

7 files changed

+107
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.jl.cov
22
*.jl.*.cov
33
*.jl.mem
4+
.DS_Store

Project.toml

+3
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ name = "PiGPIO"
22
uuid = "bb151fc1-c6dc-5496-8ed6-07f94907e623"
33
version = "0.1.0"
44

5+
[compat]
6+
julia = "1"
7+
58
[deps]
69
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"

docs/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build/
2+
site/
3+
src/examples/

docs/Project.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"

docs/make.jl

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using Documenter
2+
using PiGPIO
3+
using Literate
4+
5+
Literate.markdown(joinpath(@__DIR__, "..", "examples", "01_blink.jl"), joinpath(@__DIR__, "src", "examples"))
6+
Literate.markdown(joinpath(@__DIR__, "..", "examples", "02_blink_twice.jl"),joinpath(@__DIR__, "src", "examples"))
7+
Literate.markdown(joinpath(@__DIR__, "..", "examples", "03_rgb.jl"), joinpath(@__DIR__, "src", "examples"))
8+
9+
makedocs(
10+
sitename = "PiGPIO",
11+
format = Documenter.HTML(),
12+
modules = [PiGPIO],
13+
pages = [
14+
"index.md",
15+
"API Docs" => "api.md",
16+
"Examples" => [
17+
"Blink Once" => "examples/01_blink.md",
18+
"Blink Twice" => "examples/02_blink_twice.md",
19+
"Red-Green-Blue" => "examples/03_rgb.md"
20+
]
21+
]
22+
)
23+
24+
# Documenter can also automatically deploy documentation to gh-pages.
25+
# See "Hosting Documentation" and deploydocs() in the Documenter manual
26+
# for more information.
27+
#=deploydocs(
28+
repo = "<repository url>"
29+
)=#

docs/src/api.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# PiGPIO API
2+
3+
```@index
4+
```
5+
6+
```@autodocs
7+
Modules = [PiGPIO]
8+
```

docs/src/index.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# PiGPIO.jl
2+
3+
Documentation for PiGPIO.jl
4+
5+
### Control GPIO pins on the Raspberry Pi from Julia
6+
7+
[![PiGPIO](https://img.youtube.com/vi/UmSQjkaATk8/0.jpg)](https://www.youtube.com/watch?v=UmSQjkaATk8)
8+
9+
PiGPIO.jl is a Julia package for the Raspberry which communicates with the pigpio
10+
daemon to allow control of the general purpose
11+
input outputs (GPIO).
12+
13+
This package is an effective translation of the python package for the same.
14+
Which can be found [here](http://abyz.me.uk/rpi/pigpio/python.html)
15+
16+
## Features
17+
18+
* OS independent. Only Julia 1.0+ required.
19+
* Controls one or more Pi's.
20+
* Hardware timed pulse width modulation.
21+
* Hardware timed servo pulse.
22+
* Callbacks when any of GPIO change state.
23+
* Create and transmit precise waveforms.
24+
* Read/Write GPIO and set their modes.
25+
* Wrappers for I2C, SPI, and serial links.
26+
27+
Once a pigpio daemon is launched on the pi this package can connect to
28+
it and communicate with it to manipulate the GPIO pins of the pi. The actual
29+
work is done by the daemon. One benefit of working this way is that you can
30+
remotely access the pi over a network and multiple instances can be connected
31+
to the daemon simultaneously.
32+
33+
Launching the daemon requires sudo privileges. Launch by typing `sudo pigpiod`
34+
in the terminal.
35+
36+
## Installation and Usage
37+
38+
```julia
39+
using Pkg
40+
Pkg.add("https://github.com/JuliaBerry/PiGPIO.jl")
41+
42+
using PiGPIO
43+
44+
pi=Pi() #connect to pigpiod daemon on localhost
45+
```
46+
47+
## Example Usage
48+
49+
```julia
50+
set_mode(p::Pi, pin::Int, mode)
51+
get_mode(p::Pi, pin::Int)
52+
# mode can be INPUT or OUTPUT
53+
54+
read(p, pin)
55+
write(p, pin, state)
56+
#state can be HIGH, LOW, ON, OFF
57+
58+
set_PWM_dutycycle(p, pin, dutycyle)
59+
#dutycyle defaults to a range 0-255
60+
```

0 commit comments

Comments
 (0)