A project that runs 2 trolling motors on a boat with multiple microcontrollers on a CAN bus.
Pressing the green button lets you change mode with an up and down of the joystick.
The red button stops the motor and sends the system into mode 0, which is off.
Use the following Arduino pins on the Teensy 3.2
D23 is the left motor.
D16 is the right motor.
The motor controller is a VEX Victor SP that takes inputs generated by the Servo library. The value of 92 is neutral on the controllers.
This section describes the interpretation and value for each of the CAN messages on the trolling motor system. All nodes are running at 500k CAN with 11-bit IDs.
- ID: 0x700
- Length: 1
- Meaning
- Bit 0: upButtonState
- Bit 1: downButtonState
- Bit 2: leftButtonState
- Bit 3: rightButtonState
- Bit 4: pushButtonState
- Bit 5: doubleClick
- Bit 6: redButtonState
- Bit 7: greenButtonState
This is the message sent by the Joystick or other controller every 25 ms.
- ID: 0x201
- Length: 2
- Meaning
- Byte 0: number of modes of operation
- Byte 1: current mode number
This messages is sent by the main controller as an informational message.
- ID: 0x211
- Length: 8
All bytes are ascii characters to be displayed on the upper left character slots of a 16X2 character display.
- ID: 0x212
- Length: 8
All bytes are ascii characters to be displayed on the upper right character slots of a 16X2 character display.
- ID: 0x221
- Length: 8
All bytes are ascii characters to be displayed on the lower left character slots of a 16X2 character display.
- ID: 0x222
- Length: 8
All bytes are ascii characters to be displayed on the lower right character slots of a 16X2 character display.