private void I2CSendBit(bool bit) { if (bit) { _sda.On(); } else { _sda.Off(); } I2CSleep(); do { _scl.On(); } while (!_scl.Read()); // wait for clock stretching I2CSleep(); _scl.Off(); }
private bool I2CReadBit() { _sda.AsInput(); I2CSleep(); do { _scl.On(); } while (!_scl.Read()); // wait for clock stretching I2CSleep(); var result = _sda.Read(); _scl.Off(); return(result); }