Skip to content

A Swift library for interacting with a Raspberry Pi running the WebIOPi REST API

License

Notifications You must be signed in to change notification settings

voidrender/WebIOPiSwift

Repository files navigation

WebIOPi

Build Status Version License Platform Swift Version

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.

Example

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.

Requirements

A Raspberry Pi running WebIOPi.

Installation

WebIOPi is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "WebIOPi"

Roadmap

v0.1.0

Basic GPIO functions.

  • Get GPIO configuration
  • Get and set pin function
  • Get and set pin value
  • Send pulse to a pin
  • Send a bit sequence to a pin

v0.2.0

Apple Watch support.

v1.0.0

All API calls exposed.

  • PWM
  • Macros
  • Better error handling

Author

Isaac Overacker

License

WebIOPi is available under the MIT license. See the LICENSE file for more info.

About

A Swift library for interacting with a Raspberry Pi running the WebIOPi REST API

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published