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
Revision 3:eeb7bfd5f25e, committed 2021-11-19
- Comitter:
- Giamarchi
- Date:
- Fri Nov 19 17:52:44 2021 +0000
- Parent:
- 2:005bc21c68d6
- Commit message:
- mise a jour
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Nov 18 19:13:06 2021 +0000
+++ b/main.cpp Fri Nov 19 17:52:44 2021 +0000
@@ -14,22 +14,27 @@
//==============================================================================
// 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
+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
+DigitalIn BP(PA_1); // Ligne PA_1
//==============================================================================
// Début du Programme
int main() // Fonction principale
{
-
+ BP.mode(PullUp); // Activation de la résistance interne vers le +
//==============================================================================
while(1) // Boucle Infinie
{
- DEL_VE = 1; // Broche à 1 (DEL allumée)
- wait_ms(100); // Temporisation de 100ms (0.1s)
+ if(BP == 1)
+ DEL_VE = 1; // Broche à 1 (DEL allumée)
+ else
+ DEL_VE = 0; // Broche à 0 (DEL éteinte)
+
+ /* 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