Bonjour les amis
mon projet c'est de programmer la carte arduino nano evry pour pouvoir lire la pression d'air ,j'ai trouvé un code ,mais je l'ai pas bien compris.
Voila le code
int asPin = 0; // MPXV5004DP Vout pin - A1
double asOffsetV = 0.0; // variable for V offset (autozero)
void setup() {
Serial.begin(9600);
asOffsetV = analogRead(asPin) * .0047; // Zero speed sensor reading * 4.7 mV per count
}
void loop() {
double asVolts = 0.0;
double compVOut = 0.0;
double dynPress = 0.0;
double airSpeed = 0.0;
asVolts = analogRead(asPin) * .0047;
Serial.print("Raw reading (V): ");
Serial.println(asVolts);
Serial.print("Offset (V): ");
Serial.println(asOffsetV);
compVOut = asVolts - asOffsetV;
Serial.print("Reading - Offset (V): ");
Serial.println(compVOut);
//dynPress = (compVOut / 5.0 - .2) / .2; // Transfer function with no autozero
if(compVOut < .005) { // Set noise to 0, min speed is ~8mph
compVOut = 0.0;
}
dynPress = compVOut * 1000.0; // With autozero, dynamic pressure in kPa = Vout, convert kPa to P
Serial.print(" pression (Pa): ");
Serial.println(dynPress);
asVolts = analogRead(asPin) * .0047;
pourquoi multiplier par 0.0047
compVOut = asVolts - asOffsetV;
j'ai pas compris cette ligne de code
Merci pour votre aide