Hallo,
ich will mit meinem Roboter mal die ersten Gehversuche machen. Jetzt hab ich aber das Problem das wenn ich die RESET-Taste am RN-Control Board drücke einer der beiden Motoren los läuft und ich hab keine Ahnung wieso.
Code:$regfile = "m32def.dat" $crystal = 16000000 $baud = 9600 Config Adc = Single , Prescaler = Auto Config Porta.7 = Input Porta.7 = 1 Config Portc.6 = Output Config Portc.7 = Output Config Portb.0 = Output Config Portb.1 = Output Config Portd.4 = Output Config Portd.5 = Output Dim T As Word Start Adc Anf: Sound Portd.7 , 200 , 200 Sound Portd.7 , 400 , 400 Waitms 40 T = Getadc(7) If T > 500 Then Goto Anf Sound Portd.7 , 400 , 350 Wait 2 Sound Portd.7 , 400 , 350 Wait 1 Portc.6 = 0 'Drehrichtung Links Portc.7 = 1 Portb.0 = 0 'Drehrichtung Rechts Portb.1 = 1 Portd.4 = 1 'Motor Links Ein Portd.5 = 1 'Motor Rechts Ein Pwm1a = 150 Pwm1b = 150 Wait 1 Pwm1a = 0 Pwm1b = 0 Portd.4 = 0 Portd.5 = 0 Sound Portd.7 , 400 , 350







Zitieren

Lesezeichen