X13.Periphery.TWIDriver.SI7020.Poll C# (CSharp) Method

Poll() public method

public Poll ( byte &buf ) : bool
buf byte
return bool
      public override bool Poll(out byte[] buf) {
        buf=null;
        var now=DateTime.Now;
        if(_pt<now) {
          if(_st==0) {
            buf=new byte[] { ADDR, 0x01, 0x01, 0x02, 0xE5 }; // Trigger RH measurement hold master
            _pt=now.AddMilliseconds(500);
            _st=2;
          } else if(_st==3) {
            buf=new byte[] { ADDR, 0x01, 0x01, 0x02, 0xE3 }; // Trigger T measurement, hold master
            _pt=now.AddMilliseconds(15);
            _st=5;
          }
          return true;
        } 
        return _st>0;
      }
      /*