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:
- 2021-11-18
- Revision:
- 2:005bc21c68d6
- Parent:
- 1:95172f59262a
- Child:
- 3:eeb7bfd5f25e
File content as of revision 2:005bc21c68d6:
//==============================================================================
// FabLab Nîmes
// Initiation à la Programmation
// Auteur : Frédéric Giamarchi
// Date : 30 oct. 2021
// TP 02 : Gestion d'un feu de traffic avec bouton piéton
// Feu Vert : 5s Feu Orange : 2s Feu Rouge : 3s
// Appel piéton uniquement pendant le feu vert. Fait passer immédiatement à l'Orange
//==============================================================================
// Déclarations des ressources
#include "mbed.h"
//==============================================================================
// Déclaration des broches
DigitalOut DEL_RO(PA_11); // Ligne PA_11 sur la carte Nucléo
DigitalOut DEL_OR(PB_5); // Ligne PB_5 sur la carte Nucléo
DigitalOut DEL_VE(PB_4); // Ligne PB_4 sur la carte Nucléo
//==============================================================================
// Début du Programme
int main() // Fonction principale
{
//==============================================================================
while(1) // Boucle Infinie
{
DEL_VE = 1; // Broche à 1 (DEL allumée)
wait_ms(100); // Temporisation de 100ms (0.1s)
DEL_VE = 0; // Broche à 0 (DEL éteinte)
wait_ms(900);
} // Fin du while(1)
//==============================================================================
} // Fin du Programme
//==============================================================================