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:
- pelissier_rascol
- Date:
- 2020-09-08
- Revision:
- 29:f2c9d4570902
- Parent:
- 28:9b76214fb392
- Child:
- 30:0027d243841b
File content as of revision 29:f2c9d4570902:
#include "mbed.h"                // c'est la bibliothèque 
DigitalOut Led_rouge(LED1);
DigitalIn BP2 (PTC6);
DigitalOut Led_verte(LED2);
DigitalIn BP3 (PTA4);
int main() {
    while(1) {                   // c'est la boucle 
        if (BP2==1)           // si le BP2 est appuyé
           {
               Led_rouge=1;  // on éteint la led rouge
               }
    else                        // sinon
               {
                Led_rouge=0;  // on allume la led rouge
               }
          if (BP3==1)           // si le BP2 est appuyé
           {
               Led_verte=1;  // on éteint la led verte
               }
    else                        // sinon
               {
                Led_verte=0;  // on allume la led verte
               }      
               
       }                       // fin boucle infinie
}                              // fin programme