You are on page 1of 3

Do

If P3.1 = 0 Then
Elseif P3.0 = 0 Then
'interrupt on pin 3.0
P1 = &B11011110
P2 = &B01111110
'2.7 green 3red
Wait 2

Elseif P3.2 = 0 Then


' intterupt on pin 3.2
P2 = &B11011011
P1 = &B11011110
Wait 2

Elseif P3.3 = 0 Then


' intterupt on pin 3.3
P2 = &B11011110
P1 = &B11011011
Wait 2

Else
P1 = &B11011110
P2 = &B01111110

'red

Wait 3
P2 = &B10111111
Wait 3
P1 = &B11011011

'green

P2 = &B11011110
Wait 3
P1 = &B11011101
P2 = &B11011110
Wait 3
P1 = &B11111110

Wait 3
P1 = &B01111110
P2 = &B11011110
Wait 3
P1 = &B10111110
Wait 3
P1 = &B11011110
Wait 3
P2 = &B11011011
Wait 3
P2 = &B11011101
Wait 3

P3 = &B11111111

'yellow

P1 = &B11111111
P2 = &B11111111

End If
Loop

You might also like