X13.Periphery.TWIDriver.BH1750.Poll C# (CSharp) Méthode

Poll() public méthode

public Poll ( byte &buf ) : bool
buf byte
Résultat bool
      public override bool Poll(out byte[] buf) {
        buf=null;
        bool busy=false;
        if(_pt<DateTime.Now) {
          if(_st==0) {
            buf=new byte[] { ADDR, 0x01, 0x01, 0x00, 0x23 };  // One time L-resolution mode
            _pt=DateTime.Now.AddMilliseconds(20);
            _st=1;
            busy=true;
          } else if(_st==1) {
            buf=new byte[] { ADDR, 0x02, 0x00, 0x02 };  // Read measurement result. 
            _pt=DateTime.Now.AddMilliseconds(500);
            _st=2;
            busy=true;
          } else {
            Reset();
          }
        } else {
          busy=_st!=0;
        }
        return busy;
      }
      public override void Reset() {