Matthaeus Vorraber
/
Button_runlight_Interrupt
Button_runlight_Interrupt
main.cpp
- Committer:
- happy_alien
- Date:
- 2020-01-13
- Revision:
- 0:bf64b77eb9c9
File content as of revision 0:bf64b77eb9c9:
#include "mbed.h" // D20,D19,D18,D17,... BusOut lb(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1); // Sw4 als Interrupt definieren InterruptIn sw4(P1_16); void OneRunLightStep2(); void ButtonISR() { if(sw4.read()==1) OneRunLightStep2(); } int main() { sw4.rise(ButtonISR); while(1) { } } void OneRunLightStep2() { if(lb==0) lb=1; else lb=lb<<1; // Finster }