Although I didn't try to completely understand the routine, I did notice something off...
You have RETURN at the end of the start loop but don't see where it was GOSUB'd from. Is it suppose to be GOTO?
Just a thought and not sure if it would even make a difference.Code:start: pulsin PORTB.1,1,widthx IF widthx >= 50 && widthx < 70 Then run_motor1 IF widthx >70 && widthx <90 Then Goto run_motor2 IF widthx >90 Then Goto run_motor3 Else Goto brake Endif Return
Bookmarks