Sorry mein Fehler,
hab gedacht es ist nur ein Syntaxfehler oder etwas ähnlich einfaches.
also hier nochmal der gesmmte Code:
Code:
Rem Portc.0 = 1 --> Motor links vor
Rem Portc.1 = 1 --> Motor links rück
Rem Portc.2 = 1 --> Motor rechts vor
Rem Portc.3 = 1 --> Motor rechts rück
Rem Sensor links --> Porta.0 (sw =1)
Rem Sensor rechts --> Porta.1 (sw =1)
$regfile = "m32def.dat"
$crystal = 4000000
$baud = 9600
Config Portc = Output
Config Porta = Input
Do
If Porta = &B00000000 Then
Portc.0 = 1
Portc.1 = 0
Portc.2 = 1
Portc.3 = 0
End If
If Pina = &B00000001 Then
Portc.0 = 1
Portc.1 = 0
Portc.2 = 0
Portc.3 = 0
End If
If Pina = &B00000010 Then
Portc.0 = 0
Portc.1 = 0
Portc.2 = 1
Portc.3 = 0
End If
If Pina = &B00000011 Then
Portc.0 = 1
Portc.1 = 0
Portc.2 = 1
Portc.3 = 0
End If
Loop
Also dass Programm soll einfach zwei Sensoren auswerten und und die Motorschaltung damit füttern. Einfach damit mein Bot ner schwarzen Linie nachfahren kann.
Hoffe es ist jetzt etwas verständlicher geworden.
Lesezeichen