Mirembe Jean d'Amour / Mbed 2 deprecated P-edestrianButton

Dependencies:   mbed

main.cpp

Committer:
titig
Date:
2020-10-30
Revision:
1:bc8b34ea89fb
Parent:
0:5391ae63bb4d

File content as of revision 1:bc8b34ea89fb:

#include "mbed.h"

DigitalOut trafficYellowLight(p5);
DigitalIn pedestrianButton(p6);

int main() {
    trafficYellowLight=1;
    while (1) {
        trafficYellowLight = !pedestrianButton;
        
    if (pedestrianButton){ //once button is set to ON
    while(1){
    trafficYellowLight =!trafficYellowLight;
    wait(1);
    }
    }
         wait_ms(50);
    }
}