Keigan Motor SDK via Bluetooth Low Energy for Swift on iOS devices
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Demo
KeiganMotor.xcodeproj
KeiganMotor
LICENSE
README.md

README.md

km-swift-ble

You can control your Keigan Motor via Bluetooth Low Energy using iOS devices.

Basic

Scan

KMBluetoothManager.sharedInstance.addObserver(self, forKeyPath:"motors", options: .new, context:nil)
KMBluetoothManager.sharedInstance.scan()

Connect

let motor:KMMotor = KMBluetoothManager.sharedInstance.motors[0]
motor.connect() // Connect to Keigan Motor

Action

motor.enable() // Power on
     .speed(rpm:10) // Set speed to 10 rpm
     .runForward() // Rotate forward

Examples

Move by 90 degree per 10 seconds

for i in 0 ..< 4 {
motor.move(byDegree:90)
     .wait(10000)
}

Requirement

  • Swift4
  • iOS10+

Installation

$ git clone https://github.com/keigan-motor/km-swift-ble

NOTE Carthage and CocoaPods will be supported in the future.

Author

@tkeigan Keigan Inc.

License

MIT