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 34:8f695dbf3069, committed 2020-09-09
- Comitter:
- xavier_majorel
- Date:
- Wed Sep 09 13:09:51 2020 +0000
- Parent:
- 33:710cfcf55052
- Commit message:
- mini projet
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Sep 09 12:09:09 2020 +0000 +++ b/main.cpp Wed Sep 09 13:09:51 2020 +0000 @@ -1,19 +1,81 @@ #include "mbed.h" -DigitalOut Led_blanche(D2); +DigitalOut Led_bleue(PTB21); +DigitalOut Led_vert(PTE26); +DigitalOut Led_rouge(PTB22); +DigitalIn BP1(D3); +DigitalIn BP2(SW2); +DigitalIn BP3(SW3); -DigitalIn BP2(D3); +int main() +{ + -int main() { - while(1) { - if (BP2==1) + + while(1) + { + if ((!BP1)&&(BP2)&&(BP3)) + { + Led_bleue=1; + Led_rouge=1; + Led_vert=1; + } + + if ((!BP1)&&(!BP2)&&(BP3)) + { + Led_bleue=0; + Led_rouge=1; + Led_vert=1; + } + + + + if ((!BP1)&&(BP2)&&(!BP3)) + { + Led_bleue=1; + Led_rouge=1; + Led_vert=0; + } + + if ((!BP1)&&(!BP2)&&(!BP3)) { - Led_blanche=1; + Led_bleue=1; + Led_rouge=0; + Led_vert=1; + } + + if ((BP1)&&(BP2)&&(BP3)) + { + Led_bleue=0; + Led_rouge=1; + Led_vert=0; + } + + if ((BP1)&&(BP2)&&(!BP3)) + { + Led_bleue=0; + Led_rouge=0; + Led_vert=1; } - else + + if ((BP1)&&(!BP2)&&(BP3)) + { + Led_bleue=1; + Led_rouge=0; + Led_vert=0; + } + + if ((BP1)&&(!BP2)&&(!BP3)) { - Led_blanche=0; + Led_bleue=0; + Led_rouge=0; + Led_vert=0; } + + + + + } // fin de boucle infinie } // fin programme