use of com.qualcomm.hardware.hitechnic.HiTechnicNxtDcMotorController in project robotcode by OutoftheBoxFTC.
the class HardwareFactory method mapNxtDcMotorController.
private void mapNxtDcMotorController(HardwareMap map, DeviceManager deviceMgr, LegacyModule legacyModule, DeviceConfiguration ctrlConf) {
if (!ctrlConf.isEnabled()) {
return;
}
HiTechnicNxtDcMotorController dcMotorController = (HiTechnicNxtDcMotorController) deviceMgr.createHTDcMotorController(legacyModule, ctrlConf.getPort(), ctrlConf.getName());
map.dcMotorController.put(ctrlConf.getName(), dcMotorController);
for (MotorConfiguration motorConf : ((MotorControllerConfiguration) ctrlConf).getMotors()) {
mapMotor(map, deviceMgr, motorConf, dcMotorController);
}
VoltageSensor voltageSensor = dcMotorController;
map.voltageSensor.put(ctrlConf.getName(), voltageSensor);
}
Aggregations