Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: F746_GUI mbed SI7021
Revision 3:96a6e9e58178, committed 2021-06-22
- Comitter:
- teoff
- Date:
- Tue Jun 22 13:00:33 2021 +0000
- Parent:
- 2:8a932906e684
- Commit message:
- Final program
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jun 22 11:52:38 2021 +0000
+++ b/main.cpp Tue Jun 22 13:00:33 2021 +0000
@@ -3,17 +3,16 @@
#include "SI7021.h"
SI7021 myTempRHsensor ( I2C_SDA, I2C_SCL, SI7021::SI7021_ADDRESS, 400000 );
-Serial pc ( USBTX, USBRX );
Timer t;
Ticker newReading;
DigitalOut led1 ( LED1 );
+//Déclaration pour le capteur
SI7021::SI7021_vector_data_t myData;
SI7021::SI7021_status_t mySI7021status;
uint32_t myState;
-
void readData ( void )
{
myState++;
@@ -63,13 +62,14 @@
newReading.attach( &readData, 0.1 );
while (1) {
- NumBoutonGroup1=bGroup1.GetTouchedNumber();
+ NumBoutonGroup1=bGroup1.GetTouchedNumber();//Récupérer bouton touché
if(bGroup1.GetTouchedNumber(NumBoutonGroup1)) {
switch (NumBoutonGroup1) {
case 0 :
bGroup1.Inactivate(0);
bGroup1.Activate(1);
bGroup1.Activate(2);
+ bGroup1.Activate(3);
bGroup1.Draw(1,0xFFFFE800,0xFFFFFFFF); //Yellow
bGroup1.Draw(2,0xFFFFFFFF,0xFF000000); //White
bGroup1.Draw(3);
@@ -104,7 +104,7 @@
}
}
- NumBoutonGroup2=bGroupMode.GetTouchedNumber();
+ NumBoutonGroup2=bGroupMode.GetTouchedNumber();//Récupérer bouton touché
if(bGroupMode.GetTouchedNumber(NumBoutonGroup2)) {
switch (NumBoutonGroup2) {
case 0 :
@@ -137,10 +137,10 @@
BlinkLabel warning(250, 180, "Retour au stand", Label::LEFT, Font16);
if (bias.Slide()) {
- valBias.Draw("%d",bias.GetValue());
+ valBias.Draw("%d",bias.GetValue());//Récupérer valeur du bias
}
if (diff.Slide()) {
- valDiff.Draw("%d",diff.GetValue());
+ valDiff.Draw("%d",diff.GetValue());//Récupérer valeur du differentiel
}
sleep();
@@ -155,7 +155,7 @@
// Lecture des mesures de température et d'humidité
mySI7021status = myTempRHsensor.SI7021_ReadHumidity ( &myData );
mySI7021status = myTempRHsensor.SI7021_ReadTemperatureFromRH ( &myData );
-
+
//Affichage sur l'écran LCD des valeurs
valTemp.Draw("%0.1f", myData.Temperature);
valHumi.Draw("%0.0f", myData.RelativeHumidity);
@@ -166,7 +166,7 @@
}
time.Draw("%3.3f", t.read());
- if(t.read() >= 30) { //Condition fin de tour
+ if(t.read() >= 20) { //Condition fin de tour
nLap++;
t.reset();
}