Robin Handy
/
mbed_ledFunc
LedFunc
https://os.mbed.com/teams/ABELI2019/code/Robin-Handy/
main.cpp
- Committer:
- rob117
- Date:
- 2019-12-06
- Revision:
- 0:5fab0572b588
File content as of revision 0:5fab0572b588:
#include "mbed.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); DigitalOut led4(LED4); void allLedsOn(); void allLedsOff(); void changeLed1(); int main() { while (1) { allLedsOn(); wait_ms(500); changeLed1(); wait_ms(500); allLedsOff(); wait_ms(500); } } void allLedsOn() { led1 = 1; led2 = 1; led3 = 1; led4 = 1; } void allLedsOff() { led1 = 0; led2 = 0; led3 = 0; led4 = 0; } void changeLed1() { if(led1==1) { led1=0; } }