ichard caumet_rascol / Mbed 2 deprecated 2-GPIO

Dependencies:   mbed

Committer:
cr7sim
Date:
Tue Sep 08 14:06:19 2020 +0000
Revision:
27:4fc46d79da87
Parent:
26:175a716a53ee
Child:
28:92e2e6708035
version 1: commande led bleue avec SW8

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dan 0:7dec7e9ac085 1 #include "mbed.h"
dan 0:7dec7e9ac085 2
cr7sim 27:4fc46d79da87 3 DigitalOut Led_bleue(LED3);
cr7sim 27:4fc46d79da87 4 DigitalIn BP2 (SW2);
dan 0:7dec7e9ac085 5
cr7sim 27:4fc46d79da87 6 int main(){
dan 0:7dec7e9ac085 7 while(1) {
cr7sim 27:4fc46d79da87 8 if (BP2==1) //si le BP2 est appuyé
cr7sim 27:4fc46d79da87 9 {
cr7sim 27:4fc46d79da87 10 Led_bleue=1; // on eteint la led bleue
cr7sim 27:4fc46d79da87 11 }
cr7sim 27:4fc46d79da87 12 else // sinon
cr7sim 27:4fc46d79da87 13 {
cr7sim 27:4fc46d79da87 14 Led_bleue=0; // on alume la led bleue
cr7sim 27:4fc46d79da87 15 }
cr7sim 27:4fc46d79da87 16 } // fin boucle infinie
cr7sim 27:4fc46d79da87 17 } // fin programme
cr7sim 27:4fc46d79da87 18
cr7sim 25:24b231c2642b 19