Java DeviceInterfaceModule.setLED方法代码示例(javadeviceinterfacemodule.setled典型用法代码示例汇总)

本文整理汇总了Java中com.qualcomm.robotcore.hardware.DeviceInterfaceModule.setLED方法的典型用法代码示例。如果您正苦于以下问题:Java DeviceInterfaceModule.setLED方法的具体用法?Java DeviceInterfaceModule.setLED怎么用?Java DeviceInterfaceModule.setLED使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.qualcomm.robotcore.hardware.DeviceInterfaceModule的用法示例。


Java DeviceInterfaceModule.setLED方法代码示例(javadeviceinterfacemodule.setled典型用法代码示例汇总)

在下文中一共展示了DeviceInterfaceModule.setLED方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: runOpMode

import com.qualcomm.robotcore.hardware.DeviceInterfaceModule; //导入方法依赖的package包/类
@Override
public void runOpMode() {

  boolean               inputPin;             // Input State
  boolean               outputPin;            // Output State
  DeviceInterfaceModule dim;                  // Device Object
  DigitalChannel        digIn;                // Device Object
  DigitalChannel        digOut;               // Device Object

  // get a reference to a Modern Robotics DIM, and IO channels.
  dim = hardwareMap.get(DeviceInterfaceModule.class, "dim");   //  Use generic form of device mapping
  digIn  = hardwareMap.get(DigitalChannel.class, "digin");     //  Use generic form of device mapping
  digOut = hardwareMap.get(DigitalChannel.class, "digout");    //  Use generic form of device mapping

  digIn.setMode(DigitalChannelController.Mode.INPUT);          // Set the direction of each channel
  digOut.setMode(DigitalChannelController.Mode.OUTPUT);

  // wait for the start button to be pressed.
  telemetry.addData(">", "Press play, and then user X button to set DigOut");
  telemetry.update();
  waitForStart();

  while (opModeIsActive())  {

      outputPin = gamepad1.x ;        //  Set the output pin based on x button
      digOut.setState(outputPin);
      inputPin = digIn.getState();    //  Read the input pin

      // Display input pin state on LEDs
      if (inputPin) {
          dim.setLED(RED_LED_CHANNEL, true);
          dim.setLED(BLUE_LED_CHANNEL, false);
      }
      else {
          dim.setLED(RED_LED_CHANNEL, false);
          dim.setLED(BLUE_LED_CHANNEL, true);
      }

      telemetry.addData("Output", outputPin );
      telemetry.addData("Input", inputPin );
      telemetry.addData("LED",   inputPin ? "Red" : "Blue" );
      telemetry.update();
  }
} 
开发者ID:ykarim,项目名称:FTC2016,代码行数:45,代码来源:SensorDIO.java

示例2: runOpMode

import com.qualcomm.robotcore.hardware.DeviceInterfaceModule; //导入方法依赖的package包/类
@Override
public void runOpMode() {

  boolean               inputPin;             // Input State
  boolean               outputPin;            // Output State
  DeviceInterfaceModule dim;                  // Device Object
  DigitalChannel        digIn;                // Device Object
  DigitalChannel        digOut;               // Device Object

  // get a reference to a Modern Robotics DIM, and IO channels.
  dim = hardwareMap.get(DeviceInterfaceModule.class, "dim");   //  Use generic form of device mapping
  digIn  = hardwareMap.get(DigitalChannel.class, "digin");     //  Use generic form of device mapping
  digOut = hardwareMap.get(DigitalChannel.class, "digout");    //  Use generic form of device mapping

  digIn.setMode(DigitalChannel.Mode.INPUT);          // Set the direction of each channel
  digOut.setMode(DigitalChannel.Mode.OUTPUT);

  // wait for the start button to be pressed.
  telemetry.addData(">", "Press play, and then user X button to set DigOut");
  telemetry.update();
  waitForStart();

  while (opModeIsActive())  {

      outputPin = gamepad1.x ;        //  Set the output pin based on x button
      digOut.setState(outputPin);
      inputPin = digIn.getState();    //  Read the input pin

      // Display input pin state on LEDs
      if (inputPin) {
          dim.setLED(RED_LED_CHANNEL, true);
          dim.setLED(BLUE_LED_CHANNEL, false);
      }
      else {
          dim.setLED(RED_LED_CHANNEL, false);
          dim.setLED(BLUE_LED_CHANNEL, true);
      }

      telemetry.addData("Output", outputPin );
      telemetry.addData("Input", inputPin );
      telemetry.addData("LED",   inputPin ? "Red" : "Blue" );
      telemetry.update();
  }
} 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:45,代码来源:SensorDIO.java

示例3: runOpMode

import com.qualcomm.robotcore.hardware.DeviceInterfaceModule; //导入方法依赖的package包/类
@Override
public void runOpMode() throws InterruptedException {

    boolean inputPin;             // Input State
    boolean outputPin;            // Output State
    DeviceInterfaceModule dim;                  // Device Object
    DigitalChannel digIn;                // Device Object
    DigitalChannel digOut;               // Device Object

    // get a reference to a Modern Robotics DIM, and IO channels.
    dim = hardwareMap.get(DeviceInterfaceModule.class, "dim");   //  Use generic form of device mapping
    digIn = hardwareMap.get(DigitalChannel.class, "digin");     //  Use generic form of device mapping
    digOut = hardwareMap.get(DigitalChannel.class, "digout");    //  Use generic form of device mapping

    digIn.setMode(DigitalChannelController.Mode.INPUT);          // Set the direction of each channel
    digOut.setMode(DigitalChannelController.Mode.OUTPUT);

    // wait for the start button to be pressed.
    telemetry.addData(">", "Press play, and then user X button to set DigOut");
    telemetry.update();
    waitForStart();

    while (opModeIsActive()) {

        outputPin = gamepad1.x;        //  Set the output pin based on x button
        digOut.setState(outputPin);
        inputPin = digIn.getState();    //  READ the input pin

        // Display input pin state on LEDs
        if (inputPin) {
            dim.setLED(RED_LED_CHANNEL, true);
            dim.setLED(BLUE_LED_CHANNEL, false);
        } else {
            dim.setLED(RED_LED_CHANNEL, false);
            dim.setLED(BLUE_LED_CHANNEL, true);
        }

        telemetry.addData("Output", outputPin);
        telemetry.addData("Input", inputPin);
        telemetry.addData("LED", inputPin ? "Red" : "Blue");
        telemetry.update();
    }
} 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:44,代码来源:SensorDIO.java

本文标签属性:

示例:示例英语

代码:代码编程

java:javascript什么意思

DeviceInterfaceModule:DeviceInterfaceModule

setLED:视尔途led锂电头灯

上一篇:李佳琦直播千万观看
下一篇:Java JSType.isRecordType方法代码示例

为您推荐