I am having problems turning Off my HTCC AD02, some times it goes off but not all the time, any pointers please.
digitalWrite(Vext, LOW); //Turn power on for pin Vext
Wire.begin();
delay(500);
float battV = round((getBatteryVoltage() / 10) / 100);
delay (1000);
Calc = (NbTopsFan * 60 / 7.5); //(Pulse frequency x 60) / 7.5Q = flow rate in L/hour
Serial.print (Calc, DEC); //Prints the number calculated above
Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a new line
//Print all values to serial port
Serial.print("Flow: ");
Serial.println(Calc);
Serial.print("BatteryVoltage: ");
Serial.println(battV );
Serial.println();
//Print all welcome message to the OLED
display.init();
display.clear();
display.setFont(ArialMT_Plain_24);
display.setTextAlignment(TEXT_ALIGN_LEFT);
display.drawString(00, 00, "XXXXXXX");
display.setFont(ArialMT_Plain_10);
display.drawString(0, 28, "xxxx");
display.drawString(0, 41, "www.xxxxx");
display.display();
delay(2000);
// Print all measurements to the OLED
display.clear();
display.setFont(ArialMT_Plain_10);
display.setTextAlignment(TEXT_ALIGN_LEFT);
display.drawString(00, 00, "Flow: ");
display.drawString(00, 44, "Battery Voltage :");
display.setTextAlignment(TEXT_ALIGN_RIGHT);
display.drawString(128, 00, (String)Calc);
display.drawString(128, 44, (String)battV);
display.display();
delay(2000);
digitalWrite(Vext, HIGH); //Turn power off for pin Vext
display.stop();