Ups sorry ich hab vergessen in einzufügen
also ihr der Code:
Code:
$regfile = "m32def.dat"
$crystal = 16000000 'Quarzfrequenz
$baud = 9600
Declare Sub Motortest()
Dim I As Integer
Dim N As Integer
Dim Ton As Integer
Dim L AS Integer
' Für Motorentest
'Ports für linken Motor
Config Pinc.6 = Output 'Linker Motor Kanal 1
Config Pinc.7 = Output 'Linker Motor Kanal 2
Config Pind.4 = Output 'Linker Motor PWM
'Ports für rechten Motor
Config Pinb.0 = Output 'Rechter Motor Kanal 1
Config Pinb.1 = Output 'Rechter Motor Kanal 2
Config Pind.5 = Output 'Rechter Motor PWM
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 1
Pwm1a = 0
Pwm1b = 0
I = 0
Do
For I = 1 To 50
Pinc.6 = 1
Pinc.5 = 0
Pind.4 = 1
Pwm1a = 200
Pwm1b = 200
Next
Wait 5
Sound Portd.7 , 400 , 450 'BEEP
Sound Portd.7 , 400 , 250 'BEEP
Sound Portd.7 , 400 , 450 'BEEP
Wait 2
Loop
End
Lesezeichen