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
- Committer:
- Giamarchi
- Date:
- 2022-03-02
- Revision:
- 3:c75f8eddeaf4
- Parent:
- 2:c1a4641eeacf
File content as of revision 3:c75f8eddeaf4:
//============================================================================== // FabLab Nîmes // Initiation à la Programmation // Auteur : Frédéric Giamarchi // Date : 3 mars 2022 // TP : Anémomètre // Lecture optique par interruption // Utilisation de fonctions décrites dans un fichier séparé //============================================================================== // Déclarations des ressources #include "mbed.h" #include "fonctions.h" // Appel des fonctions du fichier : fonctions.h //============================================================================== // Déclaration des broches DigitalOut DEL(PA_11); // Ligne PA_11 sur la carte Nucléo Serial pc(USBTX, USBRX); // Dialogue Série port USB à 9600 Baud //============================================================================== // Déclaration des variables char c; // variable de type caractère float temp; // variable de type réel int16_t vitesse; // variable de type 16 bits signée //============================================================================== // Début du Programme int main() // Fonction principale { Init_Fonctions(); // Exécute cette fonction pc.printf("\r\nFabLab TP Anemometre\r\n\n"); //============================================================================== // Boucle Infinie while(1) { vitesse = Anemometre(); if(vitesse != -1) // Lecture disponible { pc.printf("Vit Vent : %d\n",vitesse); // Affichage sur Putty } } // Fin du while(1) //============================================================================== } // Fin du Programme //==============================================================================