-
Notifications
You must be signed in to change notification settings - Fork 2
Home
hcrane edited this page Sep 18, 2022
·
6 revisions
The following actions can be used.
Turn on the connection.
Task {
do {
try await DroidOperator.default.connect()
} catch {
// catch error
}
}
Turn off the connection.
Task {
do {
try await DroidOperator.default.disconnect()
} catch {
// catch error
}
}
Move forward.
Task {
do {
try await DroidOperator.default.go(at: 0.7)
} catch {
// catch error
}
}
Move back.
Task {
do {
try await DroidOperator.default.back(at: 0.3)
} catch {
// catch error
}
}
Turn towards.
Task {
do {
try await DroidOperator.default.turn(by: 30)
} catch {
// catch error
}
}
Stop moving.
Task {
do {
try await DroidOperator.default.stop(.move)
} catch {
// catch error
}
}
Change body's LED ramp color.
Task {
do {
try await DroidOperator.default.changeLEDColor(to: .blue)
} catch {
// catch error
}
}
Play sound from droid.
Task {
do {
try await DroidOperator.default.playSound(.s10)
} catch {
// catch error
}
}
Keep the action.
Task {
do {
try await DroidOperator.default.go(at: 0.7)
try await DroidOperator.default.wait(for: 2)
try await DroidOperator.default.stop(.move)
} catch {
// catch error
}
}