Skip to content

Defining Hardware

johnmeshulam edited this page Nov 7, 2019 · 5 revisions

Syntax

Hardware is defined inside the init() method of the HardwareCreator class.

To define new motors: use new <MotorType>(String name, char port); Example: new LargeMotor("myMotor", 'A');

Available motor types: LargeMotor, MediumMotor.

To define new sensors: use new <SensorType>(String name, int port); Example: new GyroSensor("myGyro", 2);

Available sensor types: GyroSensor, TouchSensor, ColorSensor, UltrasonicSensor

To define a RobotChassis, use: new RobotChassis(String leftMotorName, char leftMotorPort, String rightMotorName, char rightMotorPort, boolean isInverted);

(There are a few constructors, in case some parameters are not specified)

Clone this wiki locally