Broches sur le connecteur PH mètre
Le connecteur possède 6 broches.
TODO
const byte pHpin = A0; // Connect the sensor's Po output to analogue pin 0.
void loop(){
Serial.print("Lecture du PH :");
float mesurePH;
if( getPh( &mesurePH ) == READ_OK){
Serial.println(mesurePH);
}
}
// ----------------------------------------------------------------------------------------
// Fonction de mesure du PH qui est branché sur le port analogique
// @return : float
float getPh(float *ph){
// Read and reverse the analogue input value from the pH sensor then scale 0-14.
// La valeur 0.1 est un ajustement custom...
*ph = ((1023 - analogRead(pHpin)) / 73.07) + 0.1;
// Pas d'erreur
return READ_OK;
}