TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Isaac Overacker.
WebIOPiSwift is a Swift 3 library that wraps the WebIOPi REST API in a nice Swift package. It makes communicating with the GPIO pins on your Raspberry Pi from Swift code simple.
let pi = WebIOPi(host: "http://raspberrypi.local:8000")
pi.GPIO.setFunction(.out, pin: 3) { status in
if status == .ok {
pi.GPIO.setValue(.on, pin: 3) { status in
if status == .ok {
print("Pin 3 is now outputting a HIGH signal.")
}
}
}
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
A Raspberry Pi running WebIOPi.
WebIOPi is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "WebIOPi"
Basic GPIO functions.
All API calls exposed.
WebIOPi is available under the MIT license. See the LICENSE file for more info.