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:
- snec_student
- Date:
- 2020-09-12
- Revision:
- 32:231922dccf64
- Parent:
- 31:544222440267
- Child:
- 33:073294c58b40
File content as of revision 32:231922dccf64:
#include "mbed.h"
BusOut LED_RGB(LED3,LED2,LED1); // LED_RGB est un mot LED1(MSB) LED2 LED3 (LSB)
BusIn BP(SW2,SW3,D3); // BP est un mot D3(MSB) SW3 SW2 (LSB)
int main()
{
while(1) {
switch(BP)
{
case 3: // led eteinte
LED_RGB=7;
break;
case 2: // led bleue
LED_RGB=6;
break;
case 1: // led verte
LED_RGB=5;
break;
case 0: // led rouge
LED_RGB=3;
break;
case 7: // led cyan
LED_RGB=4;
break;
case 6: // led magenta
LED_RGB=2;
break;
case 5: // led jaune
LED_RGB=1;
break;
case 4: // led blanche
LED_RGB=0;
break;
}
} // fin boucle infinie
} // fin programme