Vous êtes sur la page 1sur 10

Outputs

Number

Name

West LEDs South LEDs


PB3
PB4
PB5

0
1
2
3
4
5
6
7
8
9
10
11

All_Red
Go_West
Transition_West
Go_South
Transition_South
Go_Pedestrian
Stop_Pedestrian_1
Stop_Pedestrian_2
Stop_Pedestrian_3
Stop_Pedestrian_4
Fixed_South
Fixed_West

0
1
2
3
4
5
6
7
8
9
10
11

All_Red
Go_West
Transition_West
Go_South
Transition_South
Go_Pedestrian
Stop_Pedestrian_1
Stop_Pedestrian_2
Stop_Pedestrian_3
Stop_Pedestrian_4
Fixed_South
Fixed_West

PB0
PB1
PB2
5
3
4

Pedestrian
Traffic LEDs
LEDs
PF3
Value
PF1

2
2
2

1 0x24
1 0x0C
1 0x14

0x24
0x0C
0x14

Inputs index
Pedestrian
LEDs
Value

Wait

rotary: West South Pedestrian

0
0
0

1
0
0

0
1
0

1
1
0

0
0
1

1
0
1

0
1
1

1
1
1

0x02
0x02
0x02

0
1
1

0
1
0

1
1
0

3
2
7

3
2
3

5
2
5

3
2
5

5
2
3

1
2
3

0x02
0x02
0x02

,
,
,
,
,
,
,
0 All_Red,Go_WestGo_SoutGo_SoutGo_PedeGo_SoutGo_PedeGo_West
1 Go_WestGo_WestTransiti Transiti Transiti Transiti Transiti Transition_West
1 All_Red,All_Red,Stop_Ped
Go_SoutGo_PedeGo_PedeGo_SoutGo_South

Index

Code

West button PE0


South button PE1
Pedestrian buPE2
All_Red
Go_West
Transition_West
Go_South
Transition_South
Go_Pedestrian
Stop_Pedestrian_1
Stop_Pedestrian_2
Stop_Pedestrian_3
Stop_Pedestrian_4
Fixed_South
Fixed_West

Go_West
Transition_West
Go_South

enum index_e {
All_Red,
Go_West,
Transition_West,
Go_South,
Transition_South,
Go_Pedestrian,
Stop_Pedestrian_1,
Stop_Pedestrian_2,
Stop_Pedestrian_3,
Stop_Pedestrian_4,
Fixed_South,
Fixed_West
};

StateType Fsm[12] = {
{ 0x24, 0x02, 0, { All_Red,Go_West,Go_South,Go_South,Go
{ 0x0C, 0x02, 1, { Go_West,Go_West,Transition_West,Trans
{ 0x14, 0x02, 1, { All_Red,All_Red,Stop_Pedestrian_2,Go_S
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }}
};

West,Go_South,Go_South,Go_Pedestrian,Go_South,Go_Pedestrian,Go_West}},
o_West,Transition_West,Transition_West,Transition_West,Transition_West,Transition_West,Transition_West}},
Red,Stop_Pedestrian_2,Go_South,Go_Pedestrian,Go_Pedestrian,Go_South,Go_South}},

n_West,Transition_West}},

Outputs
Number

Name

West LEDs South LEDs


PB3
PB4
PB5

0
1
2
3
4
5
6
7
8
9
10
11

All_Red
Go_West
Transition_West
Go_South
Transition_South
Go_Pedestrian
Stop_Pedestrian_1
Stop_Pedestrian_2
Stop_Pedestrian_3
Stop_Pedestrian_4
Fixed_South
Fixed_West

0
1
2
3
4
5
6
7
8
9
10
11

All_Red
Go_West
Transition_West
Go_South
Transition_South
Go_Pedestrian
Stop_Pedestrian_1
Stop_Pedestrian_2
Stop_Pedestrian_3
Stop_Pedestrian_4
Fixed_South
Fixed_West

PB0
PB1
PB2
5
3
4

Pedestrian
Traffic LEDs
LEDs
PF3
Value
PF1

2
2
2

1 0x24
1 0x0C
1 0x14

0x24
0x0C
0x14

Inputs index
Pedestrian
LEDs
Value

Wait

rotary: West South Pedestrian

0
0
0

1
0
0

0
1
0

1
1
0

0
0
1

1
0
1

0
1
1

1
1
1

0x02
0x02
0x02

0
1
1

0
1
0

1
1
0

3
2
7

3
2
3

5
2
5

3
2
5

5
2
3

1
2
3

0x02
0x02
0x02

,
,
,
,
,
,
,
0 All_Red,Go_WestGo_SoutGo_SoutGo_PedeGo_SoutGo_PedeGo_West
1 Go_WestGo_WestTransiti Transiti Transiti Transiti Transiti Transition_West
1 All_Red,All_Red,Stop_Ped
Go_SoutGo_PedeGo_PedeGo_SoutGo_South

Index

Code

West button PE0


South button PE1
Pedestrian buPE2
All_Red
Go_West
Transition_West
Go_South
Transition_South
Go_Pedestrian
Stop_Pedestrian_1
Stop_Pedestrian_2
Stop_Pedestrian_3
Stop_Pedestrian_4
Fixed_South
Fixed_West

Go_West
Transition_West
Go_South

#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define

All_Red 0
Go_West 1
Transition_West 2
Go_South 3
Transition_South 4
Go_Pedestrian 5
Stop_Pedestrian_1
Stop_Pedestrian_2
Stop_Pedestrian_3
Stop_Pedestrian_4
Fixed_South 10
Fixed_West 11

6
7
8
9

StateType Fsm[12] = {
{ 0x24, 0x02, 0, { All_Red,Go_West,Go_South,Go_South,Go
{ 0x0C, 0x02, 1, { Go_West,Go_West,Transition_West,Trans
{ 0x14, 0x02, 1, { All_Red,All_Red,Stop_Pedestrian_2,Go_S
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }},
{ , , , { }}
};

West,Go_South,Go_South,Go_Pedestrian,Go_South,Go_Pedestrian,Go_West}},
o_West,Transition_West,Transition_West,Transition_West,Transition_West,Transition_West,Transition_West}},
Red,Stop_Pedestrian_2,Go_South,Go_Pedestrian,Go_Pedestrian,Go_South,Go_South}},

n_West,Transition_West}},

Vous aimerez peut-être aussi