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: mbed
main.cpp
00001 //============================================================================== 00002 // FabLab Nîmes 00003 // Initiation à la Programmation 00004 // Auteur : Frédéric Giamarchi 00005 00006 // Date : 04 juin 2022 00007 // TP : Station Meteo 00008 // 00009 // Utilisation de fonctions décrites dans un fichier séparé 00010 //============================================================================== 00011 // Déclarations des ressources 00012 #include "mbed.h" 00013 #include "fonctions.h" // Appel des fonctions du fichier : fonctions.h 00014 #include "serial.h" 00015 #include "anemo.h" 00016 00017 //============================================================================== 00018 // Déclaration des variables 00019 unsigned char c; // variable de type caractère 00020 float temp; // variable de type réel 00021 unsigned int vitesse; // variable de type 16 bits signée 00022 unsigned int etat; 00023 unsigned int cmd_menu; 00024 00025 //============================================================================== 00026 // Début du Programme 00027 int main() // Fonction principale 00028 { 00029 Init_Fonctions(); // Exécute cette fonction 00030 00031 00032 Init_Serial(); 00033 00034 etat = 0; 00035 //============================================================================== 00036 // Boucle Infinie 00037 while(true) 00038 { 00039 Commande_Up(); // Lecture d'une commande montante 00040 00041 switch (etat) 00042 { 00043 case 0: // Initialisation du système 00044 Init_Anemo(); 00045 00046 cmd_menu = 0; 00047 etat = 1; 00048 break; 00049 case 1: // Menu 00050 Menu(); 00051 cmd_menu = Get_Config(); 00052 etat = 2; 00053 break; 00054 case 2: // Gestion des Instrumesnts 00055 // Gestion_Temperature(cmd_menu); 00056 Gestion_Anemometre(cmd_menu); 00057 // Gestion_Girouette(cmd_menu); 00058 // Gestion_Pluviometre(cmd_menu); 00059 etat = 3; 00060 break; 00061 case 3: // Gestion des données 00062 vitesse = Lecture_Anemometre(); 00063 if(vitesse > 0) 00064 { 00065 pc.printf("#A%d\r\n",vitesse); 00066 } 00067 etat = 1; 00068 break; 00069 default: 00070 etat = 0; 00071 break; 00072 } 00073 }// Fin du while(true) 00074 //============================================================================== 00075 }// Fin du Programme 00076 //==============================================================================
Generated on Thu Dec 1 2022 07:53:58 by
1.7.2