-
Notifications
You must be signed in to change notification settings - Fork 4
Communication with MicroMojo
The communication with MicroMojo is largely based on the Register Interface from EmbeddedMicro.
- Baudrate: 9600
A command to the Mojo consists a single bit to issue a WRITE (1) or READ (0) command, and then the address corresponding the desired parameters (32 bits) and finally a value in the case of a WRITE request (32 bits). Here are tables of the parameters:
| Parameter | Address | Values |
|---|---|---|
| Laser mode | laser number (0-6) | 0-4 |
| Laser duration | 10 + laser number (0-6) | 0-65535 |
| Laser sequence | 20 + laser number (0-6) | 0-65535 |
| TTL state | 30 + TTL number (0-6) | 0-1 |
| Servo position | 40 + servo number (0-6) | 0-65535 |
| PWM | 50 + PWM number (0-6) | 0-255 |
| Analog signal (READ only) |
60 + Analog number (0-8) | Not applicable |
| Version (READ only) |
100 | Not applicable |
Examples:
- Change the laser sequence of laser3 to 1010101010101010 (=43690):
READ/WRITE= 1
Address = 20 + 3 = 24x{0} 00010111 (where 24x{0} is 24 bits with all bits set to 0)
Value = 16x{0} 1010101010101010
Resulting sequence:
| READ/WRITE | Address | Value |
|---|---|---|
| 1 | 00000000000000000000000000010111 | 00000000000000001010101010101010 |
- Read the position of servo2:
READ/WRITE = 0
Address = 40 + 2 = 24x{0} 00101010
| READ/WRITE | Address |
|---|---|
| 0 | 00000000000000000000000000101010 |
After a READ request, the Mojo will send 32bits, corresponding to the requested value. A READ request to an unknown address will be answered by the unknown command error = 38730.