-
Notifications
You must be signed in to change notification settings - Fork 0
/
LKAlphaComSpecs.swift
143 lines (90 loc) · 3.13 KB
/
LKAlphaComSpecs.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//
// LKAlphaComSpecs.swift
//
// Generated by Ladislas de Toldi on 2018/10/02.
// Copyright © 2018 Leka Inc. All rights reserved.
//
import Foundation
public let LEKA_ALPHA_COM_SPECS: String = "3.0.0"
public struct LKFrame {
public struct start {
public static let sequence: [UInt8] = [0x2A, 0x2B, 0x2C, 0x2D]
public static let length: UInt8 = 4
}
}
public struct LKCommand {
public static let info: UInt8 = 0x70
public struct stop {
public static let led: UInt8 = 0xFD
public static let motor: UInt8 = 0xFE
public static let robot: UInt8 = 0xFF
}
public struct led {
public static let id: UInt8 = 0x10
public struct ears {
public static let all: UInt8 = 0x11
public static let range: UInt8 = 0x12
public static let single: UInt8 = 0x13
}
public struct belt {
public static let all: UInt8 = 0x14
public static let range: UInt8 = 0x15
public static let single: UInt8 = 0x16
}
public struct length {
public static let all: UInt8 = 3
public static let range: UInt8 = 1 + 1 + 3
public static let single: UInt8 = 1 + 3
}
}
public struct motor {
public static let id: UInt8 = 0x20
public static let all: UInt8 = 0x21
public static let duo: UInt8 = 0x22
public static let left: UInt8 = 0x23
public static let right: UInt8 = 0x24
public struct length {
public static let all: UInt8 = 1 + 1
public static let duo: UInt8 = 1 + 1 + 1 + 1
public static let single: UInt8 = 1 + 1
}
}
public struct motivator {
public static let id: UInt8 = 0x50
public static let length: UInt8 = 1
public static let fire: UInt8 = 0x51
public static let birds: UInt8 = 0x52
public static let rainbow: UInt8 = 0x53
public static let spin_blink: UInt8 = 0x54
public static let spin_yellow: UInt8 = 0x55
}
public struct guidance {
public static let id: UInt8 = 0x40
public static let length: UInt8 = 1
public struct translation {
public static let left: UInt8 = 0x41
public static let right: UInt8 = 0x42
public static let left_right: UInt8 = 0x43
public static let up: UInt8 = 0x44
public static let down: UInt8 = 0x45
public static let up_down: UInt8 = 0x46
}
public struct move {
public static let away: UInt8 = 0x47
public static let closer: UInt8 = 0x48
}
public struct turn {
public static let left: UInt8 = 0x49
public static let right: UInt8 = 0x4A
}
public struct tilt {
public static let left: UInt8 = 0x4B
public static let right: UInt8 = 0x4C
public static let forward: UInt8 = 0x4D
public static let backward: UInt8 = 0x4E
}
public struct misc {
public static let shake: UInt8 = 0x4F
}
}
}