Simple Attachments
Simple attachments are pre-made attachments in Volt meant to make development quicker and simpler.
What are Simple Attachments?
There are three main simple attachments:
All three can be used as is, however, they can also be extended to add more functionality.
Using Simple Attachments
There are two main ways to use a simple attachment:
- As-is
- Extended
As-is
To use a simple attachment as-is, simply create a new instance of the attachment in your robot class.
class ExampleRobot(hardwareMap: HardwareMap, initialPose: Pose2d) : Robot(hardwareMap, initialPose) { val motor = SimpleAttachmentWithDcMotor(hardwareMap, "motorName")}
(Coming Soon)
Extended
To extend a simple attachment, create a new class that inherits the simple attachment.
class ExampleAttachment(hardwareMap: HardwareMap, name: String) : SimpleAttachmentWithDcMotor(hardwareMap, name) { init { // Reverse the motor motor.direction = DcMotorSimple.Direction.REVERSE }}
(Coming Soon)