Hi,
I am building my first sentry gun, this is a college project for my capstone class and im having trouble getting control of my servos for pan and tilt in a nice fluid motion. Im using an 18m2 chip and have the servos wired in to legs 8 and 11. Now im using a keyboard with a ps/2 slot as my input i have the arrow keys all mapped out, (up=$38,down=$32,left=$34,right=$36,enter=$3F) im jus not sure why im not getting the control i want. here is a sample of what i have came up with
servo b.2,1000
dirsb=%01111111
let b0=75
pinsb=%00000000
start:
kbin #b0
select case b0
case $38
servopos b.2, 125
end select
goto start
with this code the keyboard does give a signal and trys moving the servo but, every other key does also, and the servo jus barley jerks up in a very slow pase. Now i used just a simple push button controlled program to test my servos and with the push of the button i can get it to go to positon and hold but not when i try and use the keyboard. If anyone can help i would greatly appreciate it, i have 2 weeks to complete and im stuck!! I need a little brain power!!!
Mechatronic Student
I am building my first sentry gun, this is a college project for my capstone class and im having trouble getting control of my servos for pan and tilt in a nice fluid motion. Im using an 18m2 chip and have the servos wired in to legs 8 and 11. Now im using a keyboard with a ps/2 slot as my input i have the arrow keys all mapped out, (up=$38,down=$32,left=$34,right=$36,enter=$3F) im jus not sure why im not getting the control i want. here is a sample of what i have came up with
servo b.2,1000
dirsb=%01111111
let b0=75
pinsb=%00000000
start:
kbin #b0
select case b0
case $38
servopos b.2, 125
end select
goto start
with this code the keyboard does give a signal and trys moving the servo but, every other key does also, and the servo jus barley jerks up in a very slow pase. Now i used just a simple push button controlled program to test my servos and with the push of the button i can get it to go to positon and hold but not when i try and use the keyboard. If anyone can help i would greatly appreciate it, i have 2 weeks to complete and im stuck!! I need a little brain power!!!
Mechatronic Student