BarakRL Posted April 4, 2017 Posted April 4, 2017 (edited) Since SBrick are taking their sweet time releasing a Swift library/framework, I thought I'd just write one by myself. It's an early version that supports just the basic commands - driving and stopping (with channel, power, direction), but I'll update it whenever I can. You can download the framework and a working example from my GitHub: https://github.com/BarakRL/SBrick-iOS Usage is pretty straight forward: var manager = SBrickManager(delegate: self) manager.startDiscovery() func sbrickManager(_ sbrickManager: SBrickManager, didDiscover sbrick: SBrick) { //connect sbrick.delegate = self sbrickManager.connect(to: sbrick) } func sbrickReady(_ sbrick: SBrick) { //send a command sbrick.send(command: .drive(channelId: 0, cw: true, power: 0xFF)) } Edited April 4, 2017 by BarakRL Quote
Jim Posted April 4, 2017 Posted April 4, 2017 Hey, Welcome to EB. That is really nice. Being a developer myself, I have worked with Swift and I really like it. This seems useful. Quote
Saberwing40k Posted April 4, 2017 Posted April 4, 2017 (edited) I'm sorry, but I don't quite understand what this does or accomplishes. Or is this more for SBrick Plus? Edited April 4, 2017 by Saberwing40k Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.