Here is a trial code that will be clear, I hope - pins controls have been translated into Arduino notation

//***************************************************************************************************************************************** чтение влажности
uint8_t CurPinSCL, CurPinSDA;
void SCLs0() {
pinMode(CurPinSCL, OUTPUT);
};
void SCLs1() {
pinMode(CurPinSCL, INPUT);
};
void SDAs0() {
pinMode(CurPinSDA, OUTPUT);
};
void SDAs1() {
pinMode(CurPinSDA, INPUT);
};
void StartI2C() {
SDAs0();
Pause(CFG.I2Cpause);
SCLs0();
};
void StopI2C() {
SDAs0();
Pause(CFG.I2Cpause);
SCLs1();
Pause(CFG.I2Cpause);
SDAs1();
};
uint8_t SendByteI2C(uint8_t aByte) {
uint8_t ask;
for (int i=0; i<8; i++) {
if ((aByte & 0x80) == 0) {
SDAs0();
} else {
SDAs1();
};
Pause(CFG.I2Cpause);
SCLs1();
Pause(CFG.I2Cpause);
SCLs0();
aByte <<= 1;
};
SDAs1();
SCLs1();
Pause(CFG.I2Cpause);
ask=digitalRead(CurPinSDA);
SCLs0();
return ask;
};
uint8_t ReadByteI2C() {
uint8_t aByte=0;
for (int i=0; i<8; i++) {
SCLs1();
Pause(CFG.I2Cpause);
if (digitalRead(CurPinSDA)) {
aByte|=0x80 >> i;
};
SCLs0();
Pause(CFG.I2Cpause);
};
SDAs0();
SCLs1();
Pause(CFG.I2Cpause);
SCLs0();
Pause(CFG.I2Cpause);
SDAs1();
return aByte;
};
bool CRCI2C(uint8_t d1, uint8_t d2, uint8_t aCRC) {
const uint8_t cPOLYNOMIAL(0x31);
uint8_t crc(0xFF);
crc ^= d1;
for (int i = 8; i; --i) {
crc = (crc & 0x80) ? (crc << 1) ^ cPOLYNOMIAL : (crc << 1);
};
crc ^= d2;
for (int i = 8; i; --i) {
crc = (crc & 0x80) ? (crc << 1) ^ cPOLYNOMIAL : (crc << 1);
};
return (crc==aCRC);
};
// ********************************************************************************************************************************************* GetOneHum()
void GetOneHum(uint8_t aAddr, uint8_t aPortSCL, uint8_t aPortSDA, uint8_t aCol, uint8_t aRow) {
uint8_t ask,ReadCount;
uint8_t Res[6];
uint32_t t,WaitTime;
int16_t Temp,Hum;
String s;
Temp=cErr;
Hum=cErr;
ReadCount=0;
do {
PowerOn(aPortSDA-1);
PowerOn(aPortSCL-1);
CurPinSCL=cStartSensorsPin+aPortSCL-1;
CurPinSDA=cStartSensorsPin+aPortSDA-1;
//***** Включить нагреватель
// StartI2C();
// SendByteI2C((aAddr<<1) | 0) || SendByteI2C(0x30) || SendByteI2C(0x6D);
// StopI2C();
//
//
//***** Отобразить статус
// StartI2C();
// SendByteI2C((aAddr<<1) | 0) || SendByteI2C(0xF3) || SendByteI2C(0x2D);
// StopI2C();
// StartI2C();
// SendByteI2C((aAddr<<1) | 1);
// Serial.print(ReadByteI2C(),BIN); Serial.print(" "); Serial.println(ReadByteI2C(),BIN); ReadByteI2C();
// StopI2C();
StartI2C();
ask=SendByteI2C((aAddr<<1) | 0) || SendByteI2C(0x24) || SendByteI2C(0x00);
StopI2C();
if (!ask) {
ask=1;
WaitTime=millis()+500;
StartI2C();
while (ask && (WaitTime>millis())) {
ask=SendByteI2C((aAddr<<1) | 1);
Pause(CFG.I2Cpause);
};
if (!ask) {
for (int i=0; i<6; i++) {
Res[i]=ReadByteI2C();
};
StopI2C();
if (CRCI2C(Res[0],Res[1],Res[2]) && CRCI2C(Res[3],Res[4],Res[5])) {
t = (int32_t)(((uint32_t)Res[0] << 8) | Res[1]);
Temp = ((4375 * t) >> 14) - 4500;
t = ((uint32_t)Res[3] << 8) | Res[4];
Hum = (625 * t) >> 12;
ReadCount=3;
TempReadCount++;
};
};
};
PowerOff(aPortSCL-1);
PowerOff(aPortSDA-1);
ReadCount++;
} while (ReadCount<3);
TempList[aCol][aRow]=Temp;
HumList[aCol][aRow]=Hum;
if (CFG.TempMonitor) {
if (aRow==0) {
switch (aCol) {
case 0:
Serial.print(F("Влажность подвески №1 "));
break;
case 1:
Serial.print(F("Влажность подвески №2 "));
break;
case 2:
Serial.print(F("Влажность подвески №3 "));
break;
case 3:
Serial.print(F("Влажность датчика под крышей "));
break;
case 4:
Serial.print(F("Влажность метеостанции "));
break;
};
} else {
Tab(29);
};
if (Hum == cErr) {s = F("*** ");} else {s = String(float(Hum) / 100);};
Serial.print(PadS(s,F(" "),6));
Serial.print(F("% "));
if (Temp == cErr) {s = F("*** ");} else {s = String(float(Temp) / 100);};
Serial.print(PadS(s,F(" "),6));
Serial.println(F("°C"));
};
};
// ************************************************************************************************************************************************ GetHum()
void GetHum() {
if (CFG.TempMonitor) {
Serial.println();
};
GetOneHum(0x44, 2,1,0,0);
GetOneHum(0x45, 2,1,0,1);
GetOneHum(0x44, 3,1,0,2);
GetOneHum(0x45, 3,1,0,3);
GetOneHum(0x44, 4,1,0,4);
GetOneHum(0x45, 4,1,0,5);
GetOneHum(0x44, 6,5,1,0);
GetOneHum(0x45, 6,5,1,1);
GetOneHum(0x44, 7,5,1,2);
GetOneHum(0x45, 7,5,1,3);
GetOneHum(0x44, 8,5,1,4);
GetOneHum(0x45, 8,5,1,5);
GetOneHum(0x44,10,9,2,0);
GetOneHum(0x45,10,9,2,1);
GetOneHum(0x44,11,9,2,2);
GetOneHum(0x45,11,9,2,3);
GetOneHum(0x44,12,9,2,4);
GetOneHum(0x45,12,9,2,5);
GetOneHum(0x44,14,13,3,0);
GetOneHum(0x44,16,15,4,0);
};