Changes between Version 1 and Version 2 of ControlSystems/Sensors/Ultrasonic
- Timestamp:
- Oct 11, 2018, 1:11:15 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/Sensors/Ultrasonic
v1 v2 22 22 3. Plug connector B into another DIO port (let's say DIO 1) with the white wire towards the INSIDE edge of the roboRIO 23 23 24 You can then use the ultrasonic sensor in your programs by just creating an Ultrasonic class (everything is already done for you by WPILib). A sample snippet is below:24 You can use the ultrasonic sensor in your programs by creating an Ultrasonic object. WPILib already provides an [http://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/Ultrasonic.html Ultrasonic class] that makes things easy. A sample snippet is below: 25 25 {{{ 26 26 import edu.wpi.first.wpilibj.Ultrasonic; … … 44 44 45 45 Students should first get comfortable using the sensor and displaying the range readings on the console, a good next exercise is to add collision avoidance to a robot. 46 47 * [https://www.mouser.com/ds/2/813/HCSR04-1022824.pdf HC-SR04 Datasheet]