Skip to content

Commit

Permalink
Add Documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
aviks committed Jul 9, 2019
1 parent 44a9bdc commit 9e31cbc
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
.DS_Store
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ name = "PiGPIO"
uuid = "bb151fc1-c6dc-5496-8ed6-07f94907e623"
version = "0.1.0"

[compat]
julia = "1"

[deps]
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
site/
src/examples/
3 changes: 3 additions & 0 deletions docs/Project.toml
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"
29 changes: 29 additions & 0 deletions docs/make.jl
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>"
)=#
8 changes: 8 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PiGPIO API

```@index
```

```@autodocs
Modules = [PiGPIO]
```
60 changes: 60 additions & 0 deletions docs/src/index.md
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
```

2 comments on commit 9e31cbc

@aviks
Copy link
Member Author

@aviks aviks commented on 9e31cbc Jul 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

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:

git tag -a v0.1.0 -m "<description of version>" 9e31cbc24cfcba9f35b9afa1c4db666197213ff2
git push origin v0.1.0

Please sign in to comment.