i use the basic atom pro28 chip. i know little about programming in basic.i tried to do sth like programming in micro basic studio but i didn’t do much!!!here is my problem!!!
there are 3 servos and 3 scwitches. with the 1st switch i want to control two of the servos. and to be able to turn both in the same direction. with the second switch i want to control the same 2 servos and make them rotate in opposite direction with eachother…and with the last switch iwat to rotate the last servo in both directionsss.plzzz sb help me or guide me so as to find a solution
[code]servo0 var word
servo1 var word
servo2 var word
servo3 var word
servo4 var word
servo5 var word
servo6 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
low 16
goto start
buttona = in4
if buttona = 1 then start
testing:
servo0 = 3048
servo1 = 3048
servo2 = 3048
servo3 = 3048
servo4 = 3048
servo5 = 3048
servo6 = 3048
gosub makepulses
goto testing
start:
adin16 0, servo0
adin16 1, servo1
adin16 2, servo2
adin16 3, servo3
adin16 16, servo4
adin16 17, servo5
adin16 18, servo6
serout S_OUT,i57600, [dec3 servo0\3," "]
servo0 = ((servo1+servo0)* 4)+1000
servo1 = (servo1* 4)+1000
servo2 = (servo2 * 4)+1000
servo3 = (servo3 * 4)+1000
servo4 = (servo4 * 4)+1000
servo5 = (servo5 * 4)+1000
servo6 = (servo6 * 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
pulsout 8, servo6
pause 10
return
[/code]