Here is a video of my approach to HakBots idea. Rather than use potentiometers I wanted to try using inexpensive modified servos as the pots. This provides some mechanical dampening and resistance to the motion. Eh, it was a fun project anyway. I need to add wrist rotate to the joystick and upgrade the arm.
Feedback?
Here’s the code for an Atom Pro 28 and the Bot Board II. If you press the A button when powering on it will center the servos.
Edit: I used IDE 8.0.1.7 for this project.
[code]servo0 var word
servo1 var word
servo2 var word
servo3 var word
servo4 var word
servo5 var word
buttona var bit
sound 9, [100\880, 100\988, 100\1046, 100\1175]
low 10
low 11
low 12
low 13
low 14
low 15
buttona = in4
if buttona = 1 then start
testing:
servo0 = 3048
servo1 = 3048
servo2 = 3048
servo3 = 3048
servo4 = 3048
servo5 = 3048
gosub makepulses
goto testing
start:
adin 0, servo0
adin 1, servo1
adin 2, servo2
adin 3, servo3
adin 16, servo4
adin 17, servo5
'serout S_OUT,i57600,[dec3 servo0\3," "]
servo0 = (servo0 * 4)+1000
servo1 = (servo1 * 4)+1000
servo2 = (servo2 * 4)+1000
servo3 = (servo3 * 4)+1000
servo4 = (servo4 * 4)+1000
servo5 = (servo5 * 4)+1000
gosub makepulses
goto start
makepulses:
pulsout 10, servo0
pulsout 11, servo1
pulsout 12, servo2
pulsout 13, servo3
pulsout 14, servo4
pulsout 15, servo5
pause 10
return[/code]