⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 distancesensor.java

📁 单片机上的java虚拟机 用winavr 编译
💻 JAVA
字号:
package nanovm.nibo.drivers;/** * Encapsulates the information about the five * IR-reflex-sensors. You will have to call the update Method first to get * actual values. * @author Nils Springob */public class DistanceSensor {  /**   * Maximum value from IR-sensor   */  public static final int MAXIMUM = 255;    /**   * Minimum value from IR-sensor   */  public static final int MINIMUM = 0;    /**   * ID of the left IR-sensor   */  public static final int LEFT        = 4;    /**   * ID of the left front IR-sensor   */  public static final int LEFT_FRONT  = 3;    /**   * ID of the front IR-sensor   */  public static final int FRONT       = 2;    /**   * ID of the right front IR-sensor   */  public static final int RIGHT_FRONT = 1;    /**   * ID of the right IR-sensor   */  public static final int RIGHT       = 0;    /**   * update all values   */  public static native void update();    /**   * get the value of the IR-reflex-sensor with the given ID   * @param sensor ID of the IR-sensor   * @return value of the IR-sensor   */  public static native int getSensor(int sensor);  /**   * enable and disable the IR-reflex-sensors   * @param enable true to enable sensors   */  public static native void setEnabled(boolean enable);  /**   * get status of IR-reflex-sensors   * @return true when sensors are enabled   */  public static native boolean getEnabled();  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -