Example #1
0
        private void Timer_Tick(object sender, object e)
        {
            //throw new NotImplementedException();
            var command      = new byte[1];
            var PressureData = new byte[2];
            var PDiffData    = new byte[2];
            var CurrentData  = new byte[2];

            //TODO: Find proper commands
            command[0] = 0xE5;
            sensorPressure.WriteRead(command, PressureData);

            command[0] = 0xE3;
            //analogConverter.WriteRead()

            if (adc != null && adc.IsInitialized)
            {
                try
                {
                    var rawAnalogValue = adc.readContinuous();
                }
                catch (Exception ex)
                {
                }
            }
        }
 private void timer_tick(object sender, object e)
 {
     if (adc != null && adc.IsInitialized)
     {
         try
         {
             var temp = adc.readContinuous();
             ConvertedVoltage = 0;
             ConvertedValue   = temp;
         }
         catch (Exception ex)
         {
             throw new Exception("Continuous read has failed" + ex);
         }
     }
 }