Class Hardware
java.lang.Object
org.firstinspires.ftc.teamcode.subsystems.hardware.Hardware
eg. initialization code
// class declaration public Hardware robot;
// in init robot = new Hardware(); robot.introduce(new HardwareElement(hardwareMap, DcMotorEx.class, "leftFront")); robot.init();
// in loop robot.HardwareElements.get("leftFront").device.setPower(0.5);
// class declaration public Hardware robot;
// in init robot = new Hardware(); robot.introduce(new HardwareElement(hardwareMap, DcMotorEx.class, "leftFront")); robot.init();
// in loop robot.HardwareElements.get("leftFront").device.setPower(0.5);
-
Field Summary
Modifier and TypeFieldDescriptionHashMap to hold all hardware elements in name/entry:hardwareElement format. -
Constructor Summary
ConstructorDescriptionHardware
(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, org.firstinspires.ftc.robotcore.external.Telemetry telemetry) Object that contains hardwareElements HashMap. -
Method Summary
Modifier and TypeMethodDescription<T> T
Gets a hardware element.com.qualcomm.robotcore.hardware.HardwareMap
Gets the associated hardware map.org.firstinspires.ftc.robotcore.external.Telemetry
Gets the associated telemetry.void
introduce
(HardwareElement<? extends com.qualcomm.robotcore.hardware.HardwareDevice> hardwareElement) Adds hardwareElement to hardwareElements arrayList in entry:hardwareElement format.
-
Field Details
-
hardwareElements
HashMap to hold all hardware elements in name/entry:hardwareElement format.
-
-
Constructor Details
-
Hardware
public Hardware(com.qualcomm.robotcore.hardware.HardwareMap hardwareMap, org.firstinspires.ftc.robotcore.external.Telemetry telemetry) Object that contains hardwareElements HashMap.
-
-
Method Details
-
introduce
public void introduce(HardwareElement<? extends com.qualcomm.robotcore.hardware.HardwareDevice> hardwareElement) Adds hardwareElement to hardwareElements arrayList in entry:hardwareElement format. -
get
Gets a hardware element.- Parameters:
name
- The name of the element.
-
getHardwareMap
public com.qualcomm.robotcore.hardware.HardwareMap getHardwareMap()Gets the associated hardware map. -
getTelemetry
public org.firstinspires.ftc.robotcore.external.Telemetry getTelemetry()Gets the associated telemetry.
-