Skip to content
hcrane edited this page Sep 18, 2022 · 6 revisions

Document

The following actions can be used.

- connect

Turn on the connection.

Task {
    do {
        try await DroidOperator.default.connect()
    } catch {
        // catch error
    }
}

- disconnect

Turn off the connection.

Task {
    do {
        try await DroidOperator.default.disconnect()
    } catch {
        // catch error
    }
}

- go

Move forward.

Task {
    do {
        try await DroidOperator.default.go(at: 0.7)
    } catch {
        // catch error
    }
}

- back

Move back.

Task {
    do {
        try await DroidOperator.default.back(at: 0.3)
    } catch {
        // catch error
    }
}

- turn

Turn towards.

Task {
    do {
        try await DroidOperator.default.turn(by: 30)
    } catch {
        // catch error
    }
}

- stop

Stop moving.

Task {
    do {
        try await DroidOperator.default.stop(.move)
    } catch {
        // catch error
    }
}

- changeLEDColor

Change body's LED ramp color.

Task {
    do {
        try await DroidOperator.default.changeLEDColor(to: .blue)
    } catch {
        // catch error
    }
}

- playSound

Play sound from droid.

Task {
    do {
        try await DroidOperator.default.playSound(.s10)
    } catch {
        // catch error
    }
}

- wait

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
    }
}
Clone this wiki locally