60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
/**
|
|
* Cet exemple correspond à l'application de test de la bibliothèque MeasureUnit qui
|
|
* permet de calculer la température mesurée par une matrice de thermistance
|
|
*
|
|
* Anatole SCHRAMM-HENRY
|
|
* 17/12/2019
|
|
*/
|
|
|
|
#include "MeasureUnit.h"
|
|
|
|
uint8_t analogInput[] = {PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7};
|
|
double *tempArray = NULL;
|
|
|
|
ThermistorSetting thermistorSetting(4050, 47000);
|
|
AdcSetting adcSetting(3.3, 12, 310, 3);
|
|
|
|
MeasureUnit measureUnit(analogInput, 8, 1000, thermistorSetting, adcSetting);
|
|
|
|
void setup() {
|
|
// put your setup code here, to run once:
|
|
Serial.begin(115200);
|
|
delay(5000);
|
|
Serial.println("Start setup");
|
|
|
|
Serial.println("End setup");
|
|
|
|
Serial.println("| T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 |");
|
|
|
|
}
|
|
|
|
int compteur(0);
|
|
|
|
void loop() {
|
|
// put your main code here, to run repeatedly:
|
|
tempArray = measureUnit.getTemperatures();
|
|
|
|
Serial.print("|");
|
|
for(int i(0); i < 8; i++)
|
|
{
|
|
if(i != 7)
|
|
{
|
|
Serial.print(" ");Serial.print(tempArray[i]);Serial.print(" |");
|
|
}
|
|
else
|
|
{
|
|
Serial.print(" ");Serial.print(tempArray[i]);Serial.println(" |");
|
|
}
|
|
}
|
|
|
|
//On effectue la calibration
|
|
if(compteur == 5)
|
|
{
|
|
Serial.println("********************Start calibration********************");
|
|
measureUnit.levelTemperaturesOff();
|
|
Serial.println("********************End calibration********************");
|
|
}
|
|
|
|
compteur++;
|
|
}
|