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-09
- Revision:
- 30:0027d243841b
- Parent:
- 29:f2c9d4570902
- Child:
- 31:adfe162a58a4
File content as of revision 30:0027d243841b:
#include "mbed.h" // c'est la bibliothèque DigitalOut LEDB(LED3); DigitalOut LEDR(LED1); DigitalOut LEDV(LED2); DigitalIn BP1(D3); DigitalIn BP2(PTC6); DigitalIn BP3(PTA4); int main() { while(1) { // c'est la boucle if (!BP1&&BP2&&BP3) // si le BP2 est appuyé { LEDB=1; LEDR=1; LEDV=1; } if (!BP1&&!BP2&&BP3) // si le BP2 est appuyé { LEDB=0; LEDR=1; LEDV=1; } if (!BP1&&BP2&&!BP3) // si le BP2 est appuyé { LEDB=1; LEDR=1; LEDV=0; } if (!BP1&&!BP2&&!BP3) // si le BP2 est appuyé { LEDB=1; LEDR=0; LEDV=1; } if (BP1&&BP2&&BP3) // si le BP2 est appuyé { LEDB=0; LEDR=1; LEDV=0; } if (BP1&&!BP2&&BP3) // si le BP2 est appuyé { LEDB=0; LEDR=0; LEDV=1; } if (BP1&&BP2&&!BP3) // si le BP2 est appuyé { LEDB=1; LEDR=0; LEDV=0; } if (BP1&&!BP2&&!BP3) // si le BP2 est appuyé { LEDB=0; LEDR=0; LEDV=0; } } // fin boucle infinie } // fin programme