You can control your Keigan Motor via Bluetooth Low Energy using iOS devices.
KMBluetoothManager.sharedInstance.addObserver(self, forKeyPath:"motors", options: .new, context:nil)
KMBluetoothManager.sharedInstance.scan()
let motor:KMMotor = KMBluetoothManager.sharedInstance.motors[0]
motor.connect() // Connect to Keigan Motor
motor.enable() // Power on
.speed(rpm:10) // Set speed to 10 rpm
.runForward() // Rotate forward
for i in 0 ..< 4 {
motor.move(byDegree:90)
.wait(10000)
}
- Swift4
- iOS10+
$ git clone https://github.com/keigan-motor/km-swift-ble
NOTE Carthage and CocoaPods will be supported in the future.
@tkeigan Keigan Inc.