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

📄 adcontainer.java

📁 这是一个以JAVA编写的程序,本人还没有试过,是一个简单的温度控制系统
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    * by <code>doADConvert()</code>.    *    * @param state current state of the device returned from <code>readDevice()</code>    *    * @return array with the voltage values for all channels    *    * @throws OneWireIOException on a 1-Wire communication error such as    *         no 1-Wire device present.  This could be    *         caused by a physical interruption in the 1-Wire Network due to    *         shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.    *         This is usually a recoverable error.    * @throws OneWireException on a communication or setup error with the    *         1-Wire adapter.  This is usually a non-recoverable error.    *    * @see #doADConvert(boolean[],byte[])    */   public double[] getADVoltage (byte[] state)      throws OneWireIOException, OneWireException;   /**    * Reads the value of the voltages after a <code>doADConvert(int,byte[])</code>    * method call.  If more than one channel has been read it is more    * efficient to use the <code>getADVoltage(byte[])</code> method that     * returns all channel voltage values.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param state current state of the device returned from <code>readDevice()</code>    *    * @return the voltage value for the specified channel    *    * @throws OneWireIOException on a 1-Wire communication error such as    *         no 1-Wire device present.  This could be    *         caused by a physical interruption in the 1-Wire Network due to    *         shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.    *         This is usually a recoverable error.    * @throws OneWireException on a communication or setup error with the    *         1-Wire adapter.  This is usually a non-recoverable error.    *    * @see #doADConvert(int,byte[])    * @see #getADVoltage(byte[])    */   public double getADVoltage (int channel, byte[] state)      throws OneWireIOException, OneWireException;   //--------   //-------- A/D 'get' Methods   //--------   /**    * Reads the value of the specified A/D alarm on the specified channel.    * Not all A/D devices have alarms.  Check to see if this device has    * alarms first by calling the <code>hasADAlarms()</code> method.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param alarmType the desired alarm, <code>ALARM_HIGH</code> or <code>ALARM_LOW</code>    * @param state current state of the device returned from <code>readDevice()</code>    *    * @return the alarm value in volts    *    * @throws OneWireException if this device does not have A/D alarms    *    * @see com.dalsemi.onewire.container.OneWireSensor#readDevice()    * @see #hasADAlarms()    */   public double getADAlarm (int channel, int alarmType, byte[] state)      throws OneWireException;   /**    * Checks to see if the specified alarm on the specified channel is enabled.    * Not all A/D devices have alarms.  Check to see if this device has    * alarms first by calling the <code>hasADAlarms()</code> method.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param alarmType the desired alarm, <code>ALARM_HIGH</code> or <code>ALARM_LOW</code>    * @param state current state of the device returned from <code>readDevice()</code>    *    * @return true if specified alarm is enabled    *    * @throws OneWireException if this device does not have A/D alarms    *    * @see com.dalsemi.onewire.container.OneWireSensor#readDevice()    * @see #hasADAlarms()    */   public boolean getADAlarmEnable (int channel, int alarmType, byte[] state)      throws OneWireException;   /**    * Checks the state of the specified alarm on the specified channel.    * Not all A/D devices have alarms.  Check to see if this device has    * alarms first by calling the <code>hasADAlarms()</code> method.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param alarmType the desired alarm, <code>ALARM_HIGH</code> or <code>ALARM_LOW</code>    * @param state current state of the device returned from <code>readDevice()</code>    *    * @return true if specified alarm occurred    *    * @throws OneWireException if this device does not have A/D alarms    *    * @see com.dalsemi.onewire.container.OneWireSensor#readDevice()    * @see #hasADAlarms()    * @see #getADAlarmEnable(int,int,byte[])    * @see #setADAlarmEnable(int,int,boolean,byte[])    */   public boolean hasADAlarmed (int channel, int alarmType, byte[] state)      throws OneWireException;   /**    * Returns the currently selected resolution for the specified    * channel.  This device may not have selectable resolutions,    * though this method will return a valid value.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param state current state of the device returned from <code>readDevice()</code>    *    * @return the current resolution of <code>channel</code> in volts    *    * @see #getADResolutions(int,double)    * @see #setADResolution(int,double,byte[])    */   public double getADResolution (int channel, byte[] state);   /**    * Returns the currently selected range for the specified    * channel.  This device may not have selectable ranges,    * though this method will return a valid value.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param state current state of the device returned from <code>readDevice()</code>    *    * @return the input voltage range    *     * @see #getADRanges(int)    * @see #setADRange(int,double,byte[])    */   public double getADRange (int channel, byte[] state);   //--------   //-------- A/D 'set' Methods   //--------   /**    * Sets the voltage value of the specified alarm on the specified channel.    * The method <code>writeDevice()</code> must be called to finalize    * changes to the device.  Note that multiple 'set' methods can    * be called before one call to <code>writeDevice()</code>.  Also note that    * not all A/D devices have alarms.  Check to see if this device has    * alarms first by calling the <code>hasADAlarms()</code> method.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param alarmType the desired alarm, <code>ALARM_HIGH</code> or <code>ALARM_LOW</code>    * @param alarm new alarm value    * @param state current state of the device returned from <code>readDevice()</code>    *    * @throws OneWireException if this device does not have A/D alarms    *    * @see com.dalsemi.onewire.container.OneWireSensor#writeDevice(byte[])    * @see #hasADAlarms()    * @see #getADAlarm(int,int,byte[])    * @see #getADAlarmEnable(int,int,byte[])    * @see #setADAlarmEnable(int,int,boolean,byte[])    * @see #hasADAlarmed(int,int,byte[])    */   public void setADAlarm (int channel, int alarmType, double alarm,                           byte[] state)      throws OneWireException;   /**    * Enables or disables the specified alarm on the specified channel.    * The method <code>writeDevice()</code> must be called to finalize    * changes to the device.  Note that multiple 'set' methods can    * be called before one call to <code>writeDevice()</code>.  Also note that    * not all A/D devices have alarms.  Check to see if this device has    * alarms first by calling the <code>hasADAlarms()</code> method.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param alarmType the desired alarm, <code>ALARM_HIGH</code> or <code>ALARM_LOW</code>    * @param alarmEnable true to enable the alarm, false to disable    * @param state current state of the device returned from <code>readDevice()</code>    *    * @throws OneWireException if this device does not have A/D alarms    *    * @see com.dalsemi.onewire.container.OneWireSensor#writeDevice(byte[])    * @see #hasADAlarms()    * @see #getADAlarm(int,int,byte[])    * @see #setADAlarm(int,int,double,byte[])    * @see #getADAlarmEnable(int,int,byte[])    * @see #hasADAlarmed(int,int,byte[])    */   public void setADAlarmEnable (int channel, int alarmType,                                 boolean alarmEnable, byte[] state)      throws OneWireException;   /**    * Sets the conversion resolution value for the specified channel.    * The method <code>writeDevice()</code> must be called to finalize    * changes to the device.  Note that multiple 'set' methods can    * be called before one call to <code>writeDevice()</code>.  Also note that    * not all A/D devices have alarms.  Check to see if this device has    * alarms first by calling the <code>hasADAlarms()</code> method.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param resolution one of the resolutions returned by <code>getADResolutions(int,double)</code>    * @param state current state of the device returned from <code>readDevice()</code>    *    * @see #getADResolutions(int,double)    * @see #getADResolution(int,byte[])    *    */   public void setADResolution (int channel, double resolution, byte[] state);   /**    * Sets the input range for the specified channel.    * The method <code>writeDevice()</code> must be called to finalize    * changes to the device.  Note that multiple 'set' methods can    * be called before one call to <code>writeDevice()</code>.  Also note that    * not all A/D devices have alarms.  Check to see if this device has    * alarms first by calling the <code>hasADAlarms()</code> method.    *    * @param channel channel number in the range [0 to (<code>getNumberADChannels()</code> - 1)]    * @param range one of the ranges returned by <code>getADRanges(int)</code>    * @param state current state of the device returned from <code>readDevice()</code>    *    * @see #getADRanges(int)    * @see #getADRange(int,byte[])    */   public void setADRange (int channel, double range, byte[] state);}

⌨️ 快捷键说明

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