コード例 #1
0
        internal async Task SetModeAsync(HeaterMode mode)
        {
            if (master?.Transport == null)
            {
                return;
            }

            await master.WriteSingleRegisterAsync(SLAVE_ADDRESS, HOLDING_REG_MODE, (ushort)mode);
        }
コード例 #2
0
 public EPSConfiguration(PPTMode mode, HeaterMode heatMode, byte heatLow, byte heatHigh, byte[] outNormal, byte[] outSafe,
                         ushort[] outOnDel, ushort[] outOffDel, ushort[] vBoost)
 {
     PptMode               = mode;
     BattheaterMode        = heatMode;
     BattheaterLow         = heatLow;
     BattheaterHigh        = heatHigh;
     OutputNormalValue     = outNormal;
     OutputSafeValue       = outSafe;
     OutputInitialOnDelay  = outOnDel;
     OutputInitialOffDelay = outOffDel;
     Vboost = vBoost;
 }
コード例 #3
0
ファイル: TempHum11Click.cs プロジェクト: valoni/MBN-TinyCLR
        /// <summary>
        ///     Configures the HDC1000 Click for temperature, humidity acquisition.
        /// </summary>
        /// <param name="acquisitionMode">The <see cref="AcquisitionMode" /> for measurement.</param>
        /// <param name="temperatureResolution">The <see cref="TemperatureResolution" /> for reading temperature data.</param>
        /// <param name="humidityResolution">The <see cref="HumidityResolution" /> for reading humidity data.</param>
        /// <param name="heaterMode">The <see cref="HeaterMode" /> for enabling or disabling the on-board heater.</param>
        /// <example>
        ///     Example usage:
        ///     <code language="C#">
        /// _tempHumidity.Configure(Hdc1000Click.AcquisitionMode.Sequential, Hdc1000Click.TemperatureResolution.FourteenBit, Hdc1000Click.HumidityResolution.FourteenBit, Hdc1000Click.HeaterMode.Disabled);
        /// </code>
        /// </example>
        public void Configure(AcquisitionMode acquisitionMode, TemperatureResolution temperatureResolution, HumidityResolution humidityResolution, HeaterMode heaterMode)
        {
            _acquisitionMode = acquisitionMode;

            Byte value = (Byte)((Byte)acquisitionMode | (Byte)temperatureResolution | (Byte)humidityResolution |
                                (Byte)heaterMode);

            WriteRegister(ConfigRegister, value);

            Thread.Sleep(15);
        }