Changes between Version 3 and Version 4 of ControlSystems/SoftwareTeam/Training/GettingStarted/DCMotor
- Timestamp:
- Nov 3, 2019, 7:59:59 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/SoftwareTeam/Training/GettingStarted/DCMotor
v3 v4 6 6 Create another program using the !TimedRobot java template and name it !MotorTest: 7 7 8 === Smart Motor Controller Example (Hazelnut)8 === Smart (CAN) Motor Controller Example (Hazelnut) 9 9 10 10 This example is for a robot that has a TalonSRX motor controller with its CAN bus address set to 3. A Java Class is available that makes it easy to access the extensive capabilities of the TalonSRX; the class is provided by the manufacturer (Cross The Road Electronics aka CTRE) and must be installed on the laptop and added to the project. Team laptops already have the CTRE framework installed; if your laptop does not, you can download and install it [http://www.ctr-electronics.com/control-system/hro.html#product_tabs_technical_resources here]. … … 17 17 Modify the auto-generated template code as follows: 18 18 19 * Add the following imports:19 * Import the [https://first.wpi.edu/FRC/roborio/beta/docs/java/edu/wpi/first/wpilibj/XboxController.html XboxController], [https://first.wpi.edu/FRC/roborio/beta/docs/java/edu/wpi/first/wpilibj/GenericHID.Hand.html Hand], and all of the CAN motorcontrol classes (we will be using the [https://www.ctr-electronics.com/downloads/api/java/html/classcom_1_1ctre_1_1phoenix_1_1motorcontrol_1_1can_1_1_w_p_i___talon_s_r_x.html WPI_TalonSRX] class); note the use of '.*' to import all of the classes in a package: 20 20 {{{ 21 21 import edu.wpi.first.wpilibj.XboxController;