2019/0408 Jovana Trajkovic

Dependencies:   mbed

Committer:
jovanat
Date:
Sat Nov 06 08:56:28 2021 +0000
Revision:
1:5d929bc24718
Parent:
0:f52720c66789
Child:
2:c76a73aa5822
2019/0408 Jovana Trajkovic

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jovanat 0:f52720c66789 1 // Libraries
jovanat 1:5d929bc24718 2 # include <mbed.h>
jovanat 0:f52720c66789 3
jovanat 0:f52720c66789 4 // Directives
jovanat 0:f52720c66789 5 #define LED_ON 0
jovanat 1:5d929bc24718 6 #define LED_OFF 1
jovanat 1:5d929bc24718 7 #define BUTTON 1
jovanat 0:f52720c66789 8
jovanat 0:f52720c66789 9 // Variables
jovanat 0:f52720c66789 10 DigitalIn green_led(LED1);
jovanat 1:5d929bc24718 11 DigitalOut SEL2(PB_6);
jovanat 1:5d929bc24718 12 DigitalOut SEL1(PC_7);
jovanat 1:5d929bc24718 13 DigitalOut a(PA_10);
jovanat 1:5d929bc24718 14 DigitalOut b(PA_9);
jovanat 1:5d929bc24718 15 DigitalOut c(PA_8);
jovanat 1:5d929bc24718 16 DigitalOut d(PB_10);
jovanat 1:5d929bc24718 17 DigitalOut e(PB_5);
jovanat 1:5d929bc24718 18 DigitalOut f(PB_3);
jovanat 1:5d929bc24718 19 DigitalOut g(PB_3);
jovanat 0:f52720c66789 20
jovanat 0:f52720c66789 21 // User functions
jovanat 0:f52720c66789 22
jovanat 0:f52720c66789 23 int main (){
jovanat 0:f52720c66789 24 SEL2.write(LED_ON);
jovanat 0:f52720c66789 25 a.write(LED_ON);
jovanat 0:f52720c66789 26 b.write(LED_ON);
jovanat 0:f52720c66789 27 c.write(LED_ON);
jovanat 0:f52720c66789 28 d.write(LED_ON);
jovanat 0:f52720c66789 29 e.write(LED_ON);
jovanat 0:f52720c66789 30 f.write(LED_ON);
jovanat 1:5d929bc24718 31 wait(3);
jovanat 1:5d929bc24718 32 a.write(LED_OFF);
jovanat 1:5d929bc24718 33 b.write(LED_OFF);
jovanat 1:5d929bc24718 34 c.write(LED_OFF);
jovanat 1:5d929bc24718 35 d.write(LED_OFF);
jovanat 1:5d929bc24718 36 e.write(LED_OFF);
jovanat 1:5d929bc24718 37 f.write(LED_OFF);
jovanat 1:5d929bc24718 38 g.write(LED_OFF);
jovanat 1:5d929bc24718 39 wait(3);
jovanat 0:f52720c66789 40
jovanat 0:f52720c66789 41 SEL2.write(LED_ON);
jovanat 0:f52720c66789 42 a.write(LED_ON);
jovanat 0:f52720c66789 43 b.write(LED_ON);
jovanat 0:f52720c66789 44 c.write(LED_ON);
jovanat 0:f52720c66789 45 d.write(LED_ON);
jovanat 0:f52720c66789 46 e.write(LED_ON);
jovanat 0:f52720c66789 47 f.write(LED_ON);
jovanat 0:f52720c66789 48 wait(3);
jovanat 1:5d929bc24718 49 a.write(LED_OFF);
jovanat 1:5d929bc24718 50 b.write(LED_OFF);
jovanat 1:5d929bc24718 51 c.write(LED_OFF);
jovanat 1:5d929bc24718 52 d.write(LED_OFF);
jovanat 1:5d929bc24718 53 e.write(LED_OFF);
jovanat 1:5d929bc24718 54 f.write(LED_OFF);
jovanat 1:5d929bc24718 55 g.write(LED_OFF);
jovanat 1:5d929bc24718 56 wait(3);
jovanat 1:5d929bc24718 57 b.write(LED_ON);
jovanat 1:5d929bc24718 58 c.write(LED_ON);
jovanat 1:5d929bc24718 59 wait(3);
jovanat 1:5d929bc24718 60 a.write(LED_OFF);
jovanat 1:5d929bc24718 61 b.write(LED_OFF);
jovanat 1:5d929bc24718 62 c.write(LED_OFF);
jovanat 1:5d929bc24718 63 d.write(LED_OFF);
jovanat 1:5d929bc24718 64 e.write(LED_OFF);
jovanat 1:5d929bc24718 65 f.write(LED_OFF);
jovanat 1:5d929bc24718 66 g.write(LED_OFF);
jovanat 1:5d929bc24718 67 wait(3);
jovanat 1:5d929bc24718 68 a.write(LED_ON);
jovanat 1:5d929bc24718 69 b.write(LED_ON);
jovanat 1:5d929bc24718 70 g.write(LED_ON);
jovanat 1:5d929bc24718 71 d.write(LED_ON);
jovanat 1:5d929bc24718 72 e.write(LED_ON);
jovanat 1:5d929bc24718 73 wait(3);
jovanat 1:5d929bc24718 74 a.write(LED_OFF);
jovanat 1:5d929bc24718 75 b.write(LED_OFF);
jovanat 1:5d929bc24718 76 c.write(LED_OFF);
jovanat 1:5d929bc24718 77 d.write(LED_OFF);
jovanat 1:5d929bc24718 78 e.write(LED_OFF);
jovanat 1:5d929bc24718 79 f.write(LED_OFF);
jovanat 1:5d929bc24718 80 g.write(LED_OFF);
jovanat 1:5d929bc24718 81 wait(3);
jovanat 1:5d929bc24718 82 a.write(LED_ON);
jovanat 1:5d929bc24718 83 b.write(LED_ON);
jovanat 1:5d929bc24718 84 g.write(LED_ON);
jovanat 1:5d929bc24718 85 d.write(LED_ON);
jovanat 1:5d929bc24718 86 c.write(LED_ON);
jovanat 1:5d929bc24718 87 wait(3);
jovanat 1:5d929bc24718 88 a.write(LED_OFF);
jovanat 1:5d929bc24718 89 b.write(LED_OFF);
jovanat 1:5d929bc24718 90 c.write(LED_OFF);
jovanat 1:5d929bc24718 91 d.write(LED_OFF);
jovanat 1:5d929bc24718 92 e.write(LED_OFF);
jovanat 1:5d929bc24718 93 f.write(LED_OFF);
jovanat 1:5d929bc24718 94 g.write(LED_OFF);
jovanat 1:5d929bc24718 95 wait(3);
jovanat 1:5d929bc24718 96 f.write(LED_ON);
jovanat 1:5d929bc24718 97 b.write(LED_ON);
jovanat 1:5d929bc24718 98 g.write(LED_ON);
jovanat 1:5d929bc24718 99 c.write(LED_ON);
jovanat 1:5d929bc24718 100 wait(3);
jovanat 1:5d929bc24718 101 a.write(LED_OFF);
jovanat 1:5d929bc24718 102 b.write(LED_OFF);
jovanat 1:5d929bc24718 103 c.write(LED_OFF);
jovanat 1:5d929bc24718 104 d.write(LED_OFF);
jovanat 1:5d929bc24718 105 e.write(LED_OFF);
jovanat 1:5d929bc24718 106 f.write(LED_OFF);
jovanat 1:5d929bc24718 107 g.write(LED_OFF);
jovanat 1:5d929bc24718 108 wait(3);
jovanat 1:5d929bc24718 109 f.write(LED_ON);
jovanat 1:5d929bc24718 110 a.write(LED_ON);
jovanat 1:5d929bc24718 111 g.write(LED_ON);
jovanat 1:5d929bc24718 112 c.write(LED_ON);
jovanat 1:5d929bc24718 113 d.write(LED_ON);
jovanat 1:5d929bc24718 114 wait(3);
jovanat 1:5d929bc24718 115 a.write(LED_OFF);
jovanat 1:5d929bc24718 116 b.write(LED_OFF);
jovanat 1:5d929bc24718 117 c.write(LED_OFF);
jovanat 1:5d929bc24718 118 d.write(LED_OFF);
jovanat 1:5d929bc24718 119 e.write(LED_OFF);
jovanat 1:5d929bc24718 120 f.write(LED_OFF);
jovanat 1:5d929bc24718 121 g.write(LED_OFF);
jovanat 1:5d929bc24718 122 wait(3);
jovanat 1:5d929bc24718 123 f.write(LED_ON);
jovanat 1:5d929bc24718 124 e.write(LED_ON);
jovanat 1:5d929bc24718 125 g.write(LED_ON);
jovanat 1:5d929bc24718 126 c.write(LED_ON);
jovanat 1:5d929bc24718 127 d.write(LED_ON);
jovanat 1:5d929bc24718 128 wait(3);
jovanat 1:5d929bc24718 129 a.write(LED_OFF);
jovanat 1:5d929bc24718 130 b.write(LED_OFF);
jovanat 1:5d929bc24718 131 c.write(LED_OFF);
jovanat 1:5d929bc24718 132 d.write(LED_OFF);
jovanat 1:5d929bc24718 133 e.write(LED_OFF);
jovanat 1:5d929bc24718 134 f.write(LED_OFF);
jovanat 1:5d929bc24718 135 g.write(LED_OFF);
jovanat 1:5d929bc24718 136 wait(3);
jovanat 1:5d929bc24718 137 a.write(LED_ON);
jovanat 1:5d929bc24718 138 b.write(LED_ON);
jovanat 1:5d929bc24718 139 c.write(LED_ON);
jovanat 1:5d929bc24718 140 wait(3);
jovanat 1:5d929bc24718 141 a.write(LED_OFF);
jovanat 1:5d929bc24718 142 b.write(LED_OFF);
jovanat 1:5d929bc24718 143 c.write(LED_OFF);
jovanat 1:5d929bc24718 144 d.write(LED_OFF);
jovanat 1:5d929bc24718 145 e.write(LED_OFF);
jovanat 1:5d929bc24718 146 f.write(LED_OFF);
jovanat 1:5d929bc24718 147 g.write(LED_OFF);
jovanat 1:5d929bc24718 148 wait(3);
jovanat 1:5d929bc24718 149 f.write(LED_ON);
jovanat 1:5d929bc24718 150 e.write(LED_ON);
jovanat 1:5d929bc24718 151 a.write(LED_ON);
jovanat 1:5d929bc24718 152 c.write(LED_ON);
jovanat 1:5d929bc24718 153 d.write(LED_ON);
jovanat 1:5d929bc24718 154 b.write(LED_ON);
jovanat 1:5d929bc24718 155 wait(3);
jovanat 1:5d929bc24718 156 a.write(LED_OFF);
jovanat 1:5d929bc24718 157 b.write(LED_OFF);
jovanat 1:5d929bc24718 158 c.write(LED_OFF);
jovanat 1:5d929bc24718 159 d.write(LED_OFF);
jovanat 1:5d929bc24718 160 e.write(LED_OFF);
jovanat 1:5d929bc24718 161 f.write(LED_OFF);
jovanat 1:5d929bc24718 162 g.write(LED_OFF);
jovanat 1:5d929bc24718 163 wait(3);
jovanat 1:5d929bc24718 164 f.write(LED_ON);
jovanat 1:5d929bc24718 165 g.write(LED_ON);
jovanat 1:5d929bc24718 166 a.write(LED_ON);
jovanat 1:5d929bc24718 167 c.write(LED_ON);
jovanat 1:5d929bc24718 168 b.write(LED_ON);
jovanat 1:5d929bc24718 169 wait(3);
jovanat 1:5d929bc24718 170 a.write(LED_OFF);
jovanat 1:5d929bc24718 171 b.write(LED_OFF);
jovanat 1:5d929bc24718 172 c.write(LED_OFF);
jovanat 1:5d929bc24718 173 d.write(LED_OFF);
jovanat 1:5d929bc24718 174 e.write(LED_OFF);
jovanat 1:5d929bc24718 175 f.write(LED_OFF);
jovanat 1:5d929bc24718 176 g.write(LED_OFF);
jovanat 1:5d929bc24718 177 wait(3);
jovanat 1:5d929bc24718 178 f.write(LED_ON);
jovanat 1:5d929bc24718 179 e.write(LED_ON);
jovanat 1:5d929bc24718 180 a.write(LED_ON);
jovanat 1:5d929bc24718 181 c.write(LED_ON);
jovanat 1:5d929bc24718 182 d.write(LED_ON);
jovanat 1:5d929bc24718 183 b.write(LED_ON);
jovanat 1:5d929bc24718 184 a.write(LED_OFF);
jovanat 1:5d929bc24718 185 b.write(LED_OFF);
jovanat 1:5d929bc24718 186 c.write(LED_OFF);
jovanat 1:5d929bc24718 187 d.write(LED_OFF);
jovanat 1:5d929bc24718 188 e.write(LED_OFF);
jovanat 1:5d929bc24718 189 f.write(LED_OFF);
jovanat 1:5d929bc24718 190 g.write(LED_OFF);
jovanat 1:5d929bc24718 191 wait(3);
jovanat 1:5d929bc24718 192
jovanat 1:5d929bc24718 193 SEL1.write(LED_ON);
jovanat 1:5d929bc24718 194 b.write(LED_ON);
jovanat 1:5d929bc24718 195 c.write(LED_ON);
jovanat 1:5d929bc24718 196 SEL2.write(LED_ON);
jovanat 1:5d929bc24718 197 a.write(LED_ON);
jovanat 1:5d929bc24718 198 b.write(LED_ON);
jovanat 1:5d929bc24718 199 c.write(LED_ON);
jovanat 1:5d929bc24718 200 d.write(LED_ON);
jovanat 1:5d929bc24718 201 e.write(LED_ON);
jovanat 1:5d929bc24718 202 f.write(LED_ON);
jovanat 1:5d929bc24718 203
jovanat 1:5d929bc24718 204 wait(3);
jovanat 1:5d929bc24718 205
jovanat 1:5d929bc24718 206 SEL1.write(LED_ON);
jovanat 1:5d929bc24718 207 b.write(LED_ON);
jovanat 1:5d929bc24718 208 c.write(LED_ON);
jovanat 1:5d929bc24718 209
jovanat 1:5d929bc24718 210 SEL2.write(LED_ON);
jovanat 1:5d929bc24718 211 a.write(LED_ON);
jovanat 1:5d929bc24718 212 b.write(LED_ON);
jovanat 1:5d929bc24718 213 c.write(LED_ON);
jovanat 1:5d929bc24718 214 d.write(LED_ON);
jovanat 1:5d929bc24718 215 e.write(LED_ON);
jovanat 1:5d929bc24718 216 f.write(LED_ON);
jovanat 1:5d929bc24718 217
jovanat 1:5d929bc24718 218 wait(3);
jovanat 1:5d929bc24718 219 a.write(LED_OFF);
jovanat 1:5d929bc24718 220 b.write(LED_OFF);
jovanat 1:5d929bc24718 221 c.write(LED_OFF);
jovanat 1:5d929bc24718 222 d.write(LED_OFF);
jovanat 1:5d929bc24718 223 e.write(LED_OFF);
jovanat 1:5d929bc24718 224 f.write(LED_OFF);
jovanat 1:5d929bc24718 225 g.write(LED_OFF);
jovanat 1:5d929bc24718 226 wait(3);
jovanat 1:5d929bc24718 227
jovanat 0:f52720c66789 228 b.write(LED_ON);
jovanat 0:f52720c66789 229 c.write(LED_ON);
jovanat 0:f52720c66789 230 wait(3);
jovanat 0:f52720c66789 231 a.write(LED_ON);
jovanat 0:f52720c66789 232 b.write(LED_ON);
jovanat 0:f52720c66789 233 g.write(LED_ON);
jovanat 0:f52720c66789 234 d.write(LED_ON);
jovanat 0:f52720c66789 235 e.write(LED_ON);
jovanat 0:f52720c66789 236 wait(3);
jovanat 0:f52720c66789 237 a.write(LED_ON);
jovanat 0:f52720c66789 238 b.write(LED_ON);
jovanat 0:f52720c66789 239 g.write(LED_ON);
jovanat 0:f52720c66789 240 d.write(LED_ON);
jovanat 0:f52720c66789 241 c.write(LED_ON);
jovanat 0:f52720c66789 242 wait(3);
jovanat 0:f52720c66789 243 f.write(LED_ON);
jovanat 0:f52720c66789 244 b.write(LED_ON);
jovanat 0:f52720c66789 245 g.write(LED_ON);
jovanat 0:f52720c66789 246 c.write(LED_ON);
jovanat 0:f52720c66789 247 wait(3);
jovanat 0:f52720c66789 248 f.write(LED_ON);
jovanat 0:f52720c66789 249 a.write(LED_ON);
jovanat 0:f52720c66789 250 g.write(LED_ON);
jovanat 0:f52720c66789 251 c.write(LED_ON);
jovanat 0:f52720c66789 252 d.write(LED_ON);
jovanat 0:f52720c66789 253 wait(3);
jovanat 1:5d929bc24718 254
jovanat 1:5d929bc24718 255 SEL2.write(LED_ON);
jovanat 1:5d929bc24718 256 a.write(LED_ON);
jovanat 1:5d929bc24718 257 b.write(LED_ON);
jovanat 0:f52720c66789 258 c.write(LED_ON);
jovanat 0:f52720c66789 259 d.write(LED_ON);
jovanat 1:5d929bc24718 260 e.write(LED_ON);
jovanat 1:5d929bc24718 261 f.write(LED_ON);
jovanat 1:5d929bc24718 262 SEL1.write(LED_ON);
jovanat 0:f52720c66789 263 a.write(LED_ON);
jovanat 1:5d929bc24718 264 b.write(LED_ON);
jovanat 0:f52720c66789 265 c.write(LED_ON);
jovanat 0:f52720c66789 266 d.write(LED_ON);
jovanat 1:5d929bc24718 267 e.write(LED_ON);
jovanat 1:5d929bc24718 268 f.write(LED_ON);
jovanat 0:f52720c66789 269
jovanat 1:5d929bc24718 270
jovanat 1:5d929bc24718 271 }