کد:
$regfile = "M32def.dat"
$crystal = 11059200
$baud = 9600
Dim A As String * 2
Enable Interrupts
Enable Urxc
Enable Utxc
Config Porta = Output
Do
A = Inkey()
If A = "f" Then 'forward
Porta.1 = 0
Porta.3 = 1
Porta.2 = 1
Porta.4 = 0
End If
If A = "b" Then 'back
Porta.1 = 1
Porta.3 = 0
Porta.2 = 0
Porta.4 = 1
End If
If A = "l" Then 'left
Porta.1 = 0
Porta.3 = 0
Porta.2 = 0
Porta.4 = 1
End If
If A = "r" Then 'right
Porta.1 = 1
Porta.3 = 0
Porta.2 = 0
Porta.4 = 0
End If
If A = "s" Then 'stop
Porta.1 = 0
Porta.3 = 0
Porta.2 = 0
Porta.4 = 0
End If
Loop
End