示例#1
0
 private void CheckDev(byte Address)
 {
     if (this.DeviceIDs[Address] < 1)
     {
         this.DeviceIDs[Address] = RaspberryPi.I2CSetup(Address);
     }
 }
示例#2
0
 public void Write(byte Address, byte[] Data)
 {
     if (this.DeviceIDs[Address] < 1)
     {
         this.DeviceIDs[Address] = RaspberryPi.I2CSetup(Address);
     }
     foreach (byte Byte in Data)
     {
         RaspberryPi.I2CWrite(this.DeviceIDs[Address], Byte);
     }
 }
示例#3
0
 public byte[] Read(byte Address, int DataLength)
 {
     if (this.DeviceIDs[Address] < 1)
     {
         this.DeviceIDs[Address] = RaspberryPi.I2CSetup(Address);
     }
     byte[] Buffer = new byte[DataLength];
     for (int i = 0; i < DataLength; i++)
     {
         Buffer[i] = RaspberryPi.I2CRead(this.DeviceIDs[Address]);
     }
     return(Buffer);
 }