-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far!
Let's rewrite/add another file to use the hardware class, just to make sure it was implemented correctly. Awesome job for the most part though :)
|
||
@Autonomous(name="Distance Sensor Test") | ||
public class DistanceSensorTest extends OpMode { | ||
DistanceSensor distanceSensor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break between variable initialization and your methods
DistanceSensor distanceSensor; | ||
@Override | ||
public void init() { | ||
telemetry.addData("Initializing Distance Sensor.", null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The telemetry.addData
method will appear in the format
Initializing Distance Sensor.: null
I think what you're looking for is the telemetry.addLine
method, but if you want to use the telemetry.addData
method you could do smt like
telemetry.addData("Distance Sensor", "Initializing");
telemetry.addData("Distance Sensor", "Initialized");
which I think we've done a couple times as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're using the telemetry.addData
though, get rid of the period
|
||
@Override | ||
public void loop() { | ||
distanceSensor = hardwareMap.get(DistanceSensor.class, "distanceSensor"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's write a version of this that uses the hardwareElement
class, just to make sure that you implemented it correctly there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be the same file, can be a different file, up to you
@@ -0,0 +1,24 @@ | |||
package org.firstinspires.ftc.teamcode.auton; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete the 16748-CSRC/16748-CSRC
repository to fix the javadoc check error
} | ||
|
||
DistanceSensor deviceDistanceSensor = (DistanceSensor) hardwareElement.device; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary line break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implement in the setDefaultInitializers()
method
line 56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Distance Sensor Proof of Concept for Intake :)