Уважаемые форумчане.
Есть проблема - необходимо сделать управление парой шаговых двигателей на ATbanned6
Само управление - это вызов соответствующих подпрограмм через Gosub в зависимости от сигналов на портах
Проблема в следующем. Не получается одновременного перемещения двигателей. Сначала отрабатывает один, затем -- другой, затем снова первый и т.д.
Можно ли как-то обеспечить их параллельную работу?
Спасибо!
'************ управляющая программа Do If Pinb.0 = 1 Then Gosub Azimuth_right If Pinb.1 = 1 Then Gosub Azimuth_left If Pinb.2 = 1 Then Gosub Tilt_up If Pinb.2 = 1 Then Gosub Tilt_down Loop End '************ подпрограммы перемещения Azimuth_right: Portd = &B00000001 : Incr Azimuth : Waitms Azimuth_speed Portd = &B00000011 : Incr Azimuth : Waitms Azimuth_speed Portd = &B00000010 : Incr Azimuth : Waitms Azimuth_speed Portd = &B00000110 : Incr Azimuth : Waitms Azimuth_speed Portd = &B00000100 : Incr Azimuth : Waitms Azimuth_speed Portd = &B00001100 : Incr Azimuth : Waitms Azimuth_speed Portd = &B00001000 : Incr Azimuth : Waitms Azimuth_speed Portd = &B00001001 : Incr Azimuth : Waitms Azimuth_speed Return '************* Азимут - Вращение влево Azimuth_left: Portd = &B00001001 : Decr Azimuth : Waitms Azimuth_speed Portd = &B00001000 : Decr Azimuth : Waitms Azimuth_speed Portd = &B00001100 : Decr Azimuth : Waitms Azimuth_speed Portd = &B00000100 : Decr Azimuth : Waitms Azimuth_speed Portd = &B00000110 : Decr Azimuth : Waitms Azimuth_speed Portd = &B00000010 : Decr Azimuth : Waitms Azimuth_speed Portd = &B00000011 : Decr Azimuth : Waitms Azimuth_speed Portd = &B00000001 : Decr Azimuth : Waitms Azimuth_speed Return '************* Угол места - Вращение вверх Tilt_up: Portc = &B00000001 : Incr Tilt : Waitms Tilt_speed Portc = &B00000011 : Incr Tilt : Waitms Tilt_speed Portc = &B00000010 : Incr Tilt : Waitms Tilt_speed Portc = &B00000110 : Incr Tilt : Waitms Tilt_speed Portc = &B00000100 : Incr Tilt : Waitms Tilt_speed Portc = &B00001100 : Incr Tilt : Waitms Tilt_speed Portc = &B00001000 : Incr Tilt : Waitms Tilt_speed Portc = &B00001001 : Incr Tilt : Waitms Tilt_speed Return '************* Угол места - Вращение вниз Tilt_down: Portc = &B00001001 : Decr Tilt : Waitms Tilt_speed Portc = &B00001000 : Decr Tilt : Waitms Tilt_speed Portc = &B00001100 : Decr Tilt : Waitms Tilt_speed Portc = &B00000100 : Decr Tilt : Waitms Tilt_speed Portc = &B00000110 : Decr Tilt : Waitms Tilt_speed Portc = &B00000010 : Decr Tilt : Waitms Tilt_speed Portc = &B00000011 : Decr Tilt : Waitms Tilt_speed Portc = &B00000001 : Decr Tilt : Waitms Tilt_speed Return




