پاسخ : مسیریاب
اره ! البته اونی که من نوشتم میشه 9 بیتی !
فرکانس و چقد بدم پس ؟؟؟
نوشته اصلی توسط roboreza
فرکانس و چقد بدم پس ؟؟؟
$regfile = "m32def.dat" $crystal = 8000000 $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 'default use 10 for the SW stack $framesize = 40 'default use 40 for the frame space Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 1024 '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Declare Sub Motor_right(byval Var As Byte) Declare Sub Motor_left(byval Var As Byte) '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Config Portd.0 = Output Config Portd.1 = Output Config Portd.2 = Output Config Portd.3 = Output Config Portc = Input Config Porta = Input Config Portb = Input Config Portd.7 = Input Config Portd.6 = Input '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Mr0 Alias Portd.2 Mr1 Alias Portd.3 Ml0 Alias Portd.1 Ml1 Alias Portd.0 Speed_r Alias Pwm1a Speed_l Alias Pwm1b Portd.0 = 0 Portd.1 = 0 Portd.2 = 0 Portd.3 = 0 Speed_r = 255 Speed_l = 200 '////////////////////////////////////////////////////////////////////////////// Sub Motor_right(var As Byte) Select Case Var Case 1: '// jolo Set Mr0 Reset Mr1 Case 2: '// stop Set Mr0 Set Mr1 Case 3: '// aghab Reset Mr0 Set Mr1 End Select End Sub Sub Motor_left(var As Byte) Select Case Var Case 3: '// aghab Set Ml0 Reset Ml1 Case 2: '// stop Set Ml0 Set Ml1 Case 1: '// jolo Reset Ml0 Set Ml1 End Select End Sub
دیدگاه