![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
rter
Dependencies: BluetoothSerial SeeedShieldBot mbed
main.cpp
- Committer:
- simwiu
- Date:
- 2015-11-12
- Revision:
- 0:bf723d62720d
File content as of revision 0:bf723d62720d:
#include "mbed.h" BusOut Leds (PA_9,PC_7,PB_6,PA_5,PB_5,PB_4); InterruptIn SW7 (PB_3); InterruptIn SW4 (PC_1); static int teller=0; void SW7_Pushed() { teller=teller+1; //Leds=~teller; } int main() { //Leds=~teller; SW7.fall(&SW7_Pushed); wait_ms(5); while (true) { SW4==1; teller=0; SW7.enable_irq(); wait_ms(1000); SW7.disable_irq(); if (teller >= 8) Leds=~0xFF; else if (teller >= 7) Leds=~0x7F; else if (teller >= 6) Leds=~0x3F; else if (teller >= 5) Leds=~0x1F; else if (teller >= 4) Leds=~0x0F; else if (teller >= 3) Leds=~0x07; else if (teller >= 2) Leds=~0x03; else if (teller >= 1) Leds=~0x01; else Leds=~0x00; } }