Skip to content

CAN bus

Charles Kennedy edited this page Sep 19, 2024 · 5 revisions

The CAN(Controller Area Network) bus is a communication system used by the robot, mainly for communication with the motors.

There are some commands for CAN buses .optimizeBusUtilization(); allows you to configure what the CAN bus should send out here is an example,

public void periodic() {
		if (shooterMountMotorLeft.hasResetOccurred()
				|| shooterMountMotorRight.hasResetOccurred()) {
			shooterMountMotorLeft.optimizeBusUtilization();
			shooterMountMotorRight.optimizeBusUtilization();
			shooterMountMotorLeft.getRotorPosition().setUpdateFrequency(20);
		}
	}

Clone this wiki locally