Mirembe Jean d'Amour / Mbed 2 deprecated ASSIGNMENT_CODES

Dependencies:   mbed

Committer:
titig
Date:
Sun Nov 01 11:31:10 2020 +0000
Revision:
0:c7ce501d534b
Child:
1:aa3ea7b4673e
Switch off the YELLOW light when Button is ON

Who changed what in which revision?

UserRevisionLine numberNew contents of line
titig 0:c7ce501d534b 1 #include "mbed.h"
titig 0:c7ce501d534b 2 DigitalOut trafficYellowlight(p5); //Yellow light pin declaration
titig 0:c7ce501d534b 3 DigitalIn pedestrainButton(p8); //Switch button pin declaration
titig 0:c7ce501d534b 4 int main() {
titig 0:c7ce501d534b 5 while(1)
titig 0:c7ce501d534b 6 {
titig 0:c7ce501d534b 7
titig 0:c7ce501d534b 8 trafficYellowlight=0; //Initialize Yellow light to ON
titig 0:c7ce501d534b 9 trafficYellowlight=!pedestrainButton; // Switching OFF when Button is Pressed
titig 0:c7ce501d534b 10 wait_ms(500);
titig 0:c7ce501d534b 11 }
titig 0:c7ce501d534b 12 }
titig 0:c7ce501d534b 13