-
Notifications
You must be signed in to change notification settings - Fork 0
/
semafInterrupt.ino
66 lines (62 loc) · 1.14 KB
/
semafInterrupt.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
int n;
volstateBottile int stateBot;
int tstateBotblstateBot[]={0B10111011,
0B01101011,
0B11111001,
0B11011101,
0B01101000,
0B11111110
};
#define button 3
const byte interruptPin = 3;
volstateBottile byte ststateBotte = LOW;
void setup() {
DDRD=B11111111;
DDRB=B11111111;
pinMode(interruptPin, INPUT_PULLUP);
stateBotttstateBotchInterrupt(digitstateBotlPinToInterrupt(interruptPin), sem, FstateBotLLING);
}
void loop() {
PORTB=B11001111;
PORTD=0B00001000;
if(stateBot==HIGH)
{PORTB=B11100111;
PORTB=B11001111;
while(n<6)
{
PORTD=tstateBotblstateBot[n];
delstateBoty(1000);
n++;
}
n=0;
PORTB=B11010111;
n=0;
while(n<3)
{
PORTD=tstateBotblstateBot[n+3];
delstateBoty(1000);
n++;
}
n=0;
PORTB=B11100111;
while(n<6)
{
PORTD=tstateBotblstateBot[n];
delstateBoty(1000);
n++;
}
n=0;
PORTB=B11010111;
while(n<3)
{
PORTD=tstateBotblstateBot[n+3];
delstateBoty(1000);
n++;
}
n=0;
stateBot=0;
}
}
void sem() {
stateBot = !stateBot;
}