CyberGearKit
CyberGearKit is a framework of communicating to xiaomi CyberGear.
Install / Use
/learn @CmST0us/CyberGearKitREADME
CyberGearKit
CyberGearKit is a framework of communicating to xiaomi CyberGear.
How to integrate
This is an SPM-compliant Swift Package: First, add the following line in Package.swift to your package dependencies:
.package(url: "https://github.com/CmST0us/CyberGearKit.git", branch: "master")
Then, add the module CyberGearKit – where necessary – to your target dependencies.
Usage
Create CyberGear.CANBus to communicate with socketcan interface
let canBus = CyberGear.CANBus(hostID: 1)
do {
try canBus.open()
} catch {
// do some catch
}
Create CyberGear.Motor to control motor. For example, you can make motor run in speed mode.
let motor = CyberGear.Motor(canID: 127, bus: canBus)
try! motor.runMode(.speed)
try! motor.enable()
try! motor.setTargetSpeed(5)
Use RxSwift to listen frame parse
let disposeBag = DisposeBag()
motor.motorStaus
.observe(on: MainScheduler.asyncInstance)
.subscribe { (v: CyberGearKit.CyberGear.Frame.MotorStatus) in
// do some thing
}
.disposed(by: disposeBag)
License and Contributions
This package is licensed under the term of the MIT License. Contributions are always welcome!
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
