Accept m3pi commands over a serial connection to drive an m3pi robot over a bluetooth connection.
Dependencies: m3piExpandedCommandSet mbed
Accept m3pi commands over a serial connection to drive an m3pi robot over a bluetooth connection.
Accepts messages in the form of a one-character command byte, followed by two optional additional integer bytes for the left and right wheel speeds, between 0 and 255.
Commands are:
- 'f': Drive forward. Expects to be followed by the left and right wheel speeds to set.
- 'r': Drive backwards. Expects to be followed by the left and right wheel speeds to set.
- 's': Stop driving. (Sets both wheel speeds to zero.)
- 'b': Request the battery level, which will be returned as an eight-character representation of a float.
Note that the response may not come through in a single message, but may be broken over several.
- 'z': Spin left, slowly.
- 'y': Spin right, slowly.
See this iOS program for an example of the command set in use: https://github.com/kazitasnim1/Azavea-High-School-Project/pull/3