Examples
Use-Case
Mounting Examples
Configuration


Code Example
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DigitalChannel;
@TeleOp(name = "AMReleaseDigitalSensor (Blocks to Java)")
public class AMReleaseDigitalSensor extends LinearOpMode
{
private DigitalChannel sensor_digital;
@Override
public void runOpMode()
{
sensor_digital = hardwareMap.get(DigitalChannel.class, "sensor_digital");
waitForStart();
if (opModeIsActive())
{
while (opModeIsActive())
{
if (sensor_digital.getState())
{
telemetry.addData("Button Pressed?", "FALSE");
}
else
{
telemetry.addData("Button Pressed?", "TRUE");
}
telemetry.update();
}
}
}
}Last updated
Was this helpful?
