SWJTU
/
main_1
test
main.cpp
- Committer:
- chentao88
- Date:
- 2020-05-15
- Revision:
- 0:2ab98cdf79ea
File content as of revision 0:2ab98cdf79ea:
#include "mbed.h" InterruptIn button(SW2); DigitalOut led1(LED_RED); DigitalOut led2(LED_GREEN); DigitalOut led3(LED_BLUE); DigitalOut flash(LED4); void flip() { led1 = !led1; led2 = !led2; led3 = !led3; } int main() { //button.rise(&flip); // attach the address of the flip function to the rising edge while(1) { // wait around, interrupts will interrupt this! //led1 = 0; //led2 = 0; //led3 = 0; //while(button){ flash = !flash; //wait(0.25); //flip(); //} } }