Вы находитесь на странице: 1из 3

$regfile "m8535.

dat"
$crystal = 12000000

Config Porta = Input


Config Portd = Output

Awal:
If Pina = &H01 Then Goto Led1
If Pina = &H02 Then Goto Led2
If Pina = &H04 Then Goto Led3
If Pina = &H08 Then Goto Led4
If Pina = &H10 Then Goto Mati
Goto Awal

Led1:
Portd = &H01
Waitms 1
Portd = &H00
Waitms 1
If Pina = &H02 Then Goto Led2
If Pina = &H04 Then Goto Led3
If Pina = &H08 Then Goto Led4
If Pina = &H10 Then Goto Mati
Goto Led1

Led2:
Portd = &H02
Waitms 1
Portd = &H00
Waitms 1
If Pina = &H01 Then Goto Led1

If Pina = &H04 Then Goto Led3


If Pina = &H08 Then Goto Led4
If Pina = &H10 Then Goto Mati
Goto Led2

Led3:
Portd = &H04
Waitms 1
Portd = &H00
Waitms 1
If Pina = &H01 Then Goto Led1
If Pina = &H02 Then Goto Led2
If Pina = &H08 Then Goto Led4
If Pina = &H10 Then Goto Mati
Goto Led3

Led4:
Portd = &H08
Waitms 1
Portd = &H00
Waitms 1
If Pina = &H01 Then Goto Led 1
If Pina = &H02 Then Goto Led 2
If Pina = &H04 Then Goto Led 3
If Pina = &H10 Then Goto Mati
Goto Led4

Mati:
Portd = &H00
If Pina = &H01 Then Goto Led1
If Pina = &H02 Then Goto Led2

If Pina = &H04 Then Goto Led3


If Pina = &H08 Then Goto Led4
Goto Mati

End

Вам также может понравиться