Commit a9e9d6ce authored by Maxime Robin's avatar Maxime Robin

affichages OK mesure ampli OK

parent f5eac720
......@@ -53,8 +53,7 @@ i2ckeypad kpd = i2ckeypad(PCF8574_ADDR, ROWS, COLS);
char key;
// MCP3424 - Ampli analogique faibles tensions with Address of I2C
MCP3424 MCP(0x6E);
long mesureRadiometre=0; // mesure post-conversion avec le coefficient
MCP3424 MCP(0x68);
// instance de l'interface thermocouple MAX 31856
// === ATTENTION === PINS à modifer (09/02/2017)
......@@ -77,6 +76,7 @@ float coeffCalibrationRadiometres = 0;
void saisieCoeffCalibration() {
Serial.println("Saisie coeff");
char CursorCoeff=0;
coeffCalibrationRadiometres=0;
lcd.clear();
lcd.setCursor(0,0); lcd.print("Coeff calibration"); // BONUS : * pour la virgule, # pour valider. ');
lcd.setCursor(0,1); lcd.print("c=");
......@@ -147,23 +147,23 @@ void configurationAmpli() {
case 1: {
lcd.setCursor(0, 0);
lcd.print("pyrheliometre");
MCP.Configuration(1,16,1,8);} break;
MCP.Configuration(1,16,0,8);} break;
case 2: {
lcd.setCursor(0, 0);
lcd.print("pyranometre");
MCP.Configuration(1,16,1,8);} break;
MCP.Configuration(1,16,0,8);} break;
case 3: {
lcd.setCursor(0, 0);
lcd.print("pyrgeometre");
MCP.Configuration(1,18,1,8);} break;
MCP.Configuration(1,18,0,8);} break;
case 4: {
lcd.setCursor(0, 0);
lcd.print("radiometre IR120");} break;
MCP.Configuration(1,16,1,4);
MCP.Configuration(1,16,0,4);
case 5: {
lcd.setCursor(0, 0);
lcd.print("capteur PAR Quantum");
MCP.Configuration(1,16,1,8);} break;
MCP.Configuration(1,16,0,8);} break;
}
}
......@@ -176,15 +176,15 @@ void mesureAmpli() {
lcd.clear();
Serial.println("Entree mesure ampli");
long voltage;
long voltage, mesureRadiometre=0; // mesure post-conversion avec le coefficient
MCP.NewConversion(); // New conversion is initiated
voltage=MCP.Measure(); // Measure, note that the library waits for a complete conversion
// mesure actuellement en microvolts
voltage/=1000.; // conversion en mV
//voltage/=1000.; // conversion en mV
lcd.setCursor(0,0); lcd.print("V=");
lcd.setCursor(2,0); lcd.print(voltage);
lcd.setCursor(8,0); lcd.print(" mV");
lcd.setCursor(8,0); lcd.print(" uV");
// Conversion en fonction du coefficient
mesureRadiometre=voltage*coeffCalibrationRadiometres;
......@@ -304,14 +304,14 @@ void mesureSHT75() {
// =============================================
void setup()
{
Serial.begin(115200);
Wire.begin();
Serial.println("YOYOYO \n");
kpd.init();
Serial.print("Testeur instantane TEST\n\n");
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
Serial.begin(115200);
Wire.begin();
Serial.println("YOYOYO \n");
kpd.init();
Serial.print("Testeur instantane TEST\n\n");
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
maxThermocouple.begin(); maxThermocouple.setThermocoupleType(MAX31856_TCTYPE_K);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment