![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
2019/0408 Jovana Trajkovic
Diff: main.cpp
- Revision:
- 1:5d929bc24718
- Parent:
- 0:f52720c66789
- Child:
- 2:c76a73aa5822
--- a/main.cpp Sat Nov 06 08:15:17 2021 +0000 +++ b/main.cpp Sat Nov 06 08:56:28 2021 +0000 @@ -1,13 +1,22 @@ // Libraries - -#include <mbed> +# include <mbed.h> // Directives #define LED_ON 0 +#define LED_OFF 1 +#define BUTTON 1 // Variables DigitalIn green_led(LED1); -DigitalOut green_led(LED1); +DigitalOut SEL2(PB_6); +DigitalOut SEL1(PC_7); +DigitalOut a(PA_10); +DigitalOut b(PA_9); +DigitalOut c(PA_8); +DigitalOut d(PB_10); +DigitalOut e(PB_5); +DigitalOut f(PB_3); +DigitalOut g(PB_3); // User functions @@ -19,6 +28,15 @@ d.write(LED_ON); e.write(LED_ON); f.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); SEL2.write(LED_ON); a.write(LED_ON); @@ -28,6 +46,185 @@ e.write(LED_ON); f.write(LED_ON); wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + b.write(LED_ON); + c.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + a.write(LED_ON); + b.write(LED_ON); + g.write(LED_ON); + d.write(LED_ON); + e.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + a.write(LED_ON); + b.write(LED_ON); + g.write(LED_ON); + d.write(LED_ON); + c.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + f.write(LED_ON); + b.write(LED_ON); + g.write(LED_ON); + c.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + f.write(LED_ON); + a.write(LED_ON); + g.write(LED_ON); + c.write(LED_ON); + d.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + f.write(LED_ON); + e.write(LED_ON); + g.write(LED_ON); + c.write(LED_ON); + d.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + a.write(LED_ON); + b.write(LED_ON); + c.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + f.write(LED_ON); + e.write(LED_ON); + a.write(LED_ON); + c.write(LED_ON); + d.write(LED_ON); + b.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + f.write(LED_ON); + g.write(LED_ON); + a.write(LED_ON); + c.write(LED_ON); + b.write(LED_ON); + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + f.write(LED_ON); + e.write(LED_ON); + a.write(LED_ON); + c.write(LED_ON); + d.write(LED_ON); + b.write(LED_ON); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + + SEL1.write(LED_ON); + b.write(LED_ON); + c.write(LED_ON); + SEL2.write(LED_ON); + a.write(LED_ON); + b.write(LED_ON); + c.write(LED_ON); + d.write(LED_ON); + e.write(LED_ON); + f.write(LED_ON); + + wait(3); + + SEL1.write(LED_ON); + b.write(LED_ON); + c.write(LED_ON); + + SEL2.write(LED_ON); + a.write(LED_ON); + b.write(LED_ON); + c.write(LED_ON); + d.write(LED_ON); + e.write(LED_ON); + f.write(LED_ON); + + wait(3); + a.write(LED_OFF); + b.write(LED_OFF); + c.write(LED_OFF); + d.write(LED_OFF); + e.write(LED_OFF); + f.write(LED_OFF); + g.write(LED_OFF); + wait(3); + b.write(LED_ON); c.write(LED_ON); wait(3); @@ -54,22 +251,21 @@ c.write(LED_ON); d.write(LED_ON); wait(3); - f.write(LED_ON); - e.write(LED_ON); - g.write(LED_ON); + + SEL2.write(LED_ON); + a.write(LED_ON); + b.write(LED_ON); c.write(LED_ON); d.write(LED_ON); - wait(3); + e.write(LED_ON); + f.write(LED_ON); + SEL1.write(LED_ON); a.write(LED_ON); - b.write(LED_ON); - c.write(LED_ON); - wait(3); - f.write(LED_ON); - e.write(LED_ON); - a.write(LED_ON); + b.write(LED_ON); c.write(LED_ON); d.write(LED_ON); - - + e.write(LED_ON); + f.write(LED_ON); - + +}