Hello,
I have a question about reversing servos i am currently building a remote controlled boat that has a turret with a fishing pole with reel and everything on it (cool?) but i can only get my servos to turn one way. I have tried messing around with different values with pretty much everything but the most i could get was a fidget in the opposite direction. Here is my code.
The manual says that the initial state of the pin determines the polarity of the pulse, so i added the LOW and HIGH values before it sends the pulse but I'm thinking that its not that easy. I have tried to adapt a sweeping program but i couldn't get it to run continuously, any help in getting them to turn the other way would be greatly appreciated.Code:symbol TRISB = 134 symbol TRISA = $85 symbol PORTB = 6 symbol PORTA = 5 poke TRISB,0 poke TRISA,255 main: peek PORTA,B0 if bit0 = 1 then Go_Turret 'drive turret if bit0 = 0 then main 'check again Go_turret: peek PORTA,B0 'check portA values if bit1 = 1 then turret_left if bit2 = 1 then turret_right if bit3 = 1 then pole_up if bit4 = 1 then pole_down goto main turret_left: 'moves turret left low 1 'should move clockwise? pulsout 1, 1000 pause 10 goto main turret_right: 'moves turret right high 1 'should move counterclockwise? pulsout 1, 1000 pause 10 goto main pole_up: 'moves the pole up low 2 'move servo clockwise? pulsout 2, 1000 pause 10 goto main pole_down: 'moves the pole down high 2 'should move servo counterclockwise? pulsout 2, 1000 pause 10 goto main
Thanks





Bookmarks