Examples
Wiring Note
The Koors40 CAN brushed speed controller comes with one set of twisted pair wires that are yellow and green. For CAN bus control, wiring is as expected and matches the colors of the CAN bus. For PWM control, the green wire acts as ground and the yellow wire acts as the PWM signal
Code Example
You must first install the AndyMark vendor libraries. Instructions can be found here
View Device API for a comprehensive list of commands
import com.andymark.jni.AM_CAN_Koors40;
//Initialize Device
//The device's default CAN is 0. Change it using AndyMark IPK
//SystemCore Bus 2 with device ID 0
myKoors40 = new AM_CAN_Koors40(2,0);
//commands to set brake and coast mode
myKoors40.setBrakeMode();
myKoors40.setCoastMode();
//Command to set speed (-100 - 100)
myKoors40.setSpeed(mySpeed);//File to include
#include "AM_CAN_Koors40.h"
//Initialize Device
//The device's default CAN is 0. Change it using AndyMark IPK
//SystemCore Bus 2 with device ID 0
CAN_Koors40 myKoors40{2,0};
//commands to set brake and coast mode
myKoors40.setBrakeMode();
myKoors40.setCoastMode();
//Command to set speed (-100 - 100)
myKoors40.setSpeed(mySpeed);Last updated
Was this helpful?

