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-02-03
- Revision:
- 2:f9f2ca55c5f8
- Parent:
- 1:95172f59262a
File content as of revision 2:f9f2ca55c5f8:
//==============================================================================
// FabLab Nîmes
// Initiation à la Programmation
// Auteur : Frédéric Giamarchi
// Date : 21 janv. 2022
// TP :
// Test des Timers
//==============================================================================
// Déclarations des ressources
#include "mbed.h"
Timer t;
//==============================================================================
// Déclaration des broches
DigitalOut DEL_RO(PA_11); // Ligne PA_11 sur la carte Nucléo
Serial pc(USBTX, USBRX); // Dialogue Série port USB à 9600 Baud
AnalogIn POT(PA_0); // Ligne PA_0 en entrée analogique
//==============================================================================
// Déclaration des variables
uint8_t variable; // variable de type entier (0 à 255)
char c; // variable de type caractère
float temp; // variable de type réel
uint16_t mesure;
//==============================================================================
// Déclaration des Fonctions
void Ma_Fonction(void)
{
variable = 0;
}
//==============================================================================
// Début du Programme
int main() // Fonction principale
{
// Autres valeurs standard : 9600 19200 38400 57600 115200
pc.baud(38400);
pc.printf("\r\nFabLab TP Test Timer\r\n\n");
variable = 0;
// Test de l'horloge Systeme
pc.printf("Horloge CPU a %d Hz\r\n", SystemCoreClock);
t.start(); // Compteur activé
// 10 caractères, chaque caractère compte 10 bits (8 + 1 bit de start et 1 bit de stop)
pc.printf("Bonjour !\n");
t.stop(); // Compteur stoppé
pc.printf("Duree du texte : %f s\n",t.read());
//==============================================================================
// Boucle Infinie
while(1)
{
} // Fin du while(1)
//==============================================================================
} // Fin du Programme
//==============================================================================