Hi, I'm always here to ask for help (cause I can't give advice) ...
I'm sure there are posts relevent to this already online here but I'm not sure what to search to find them...
OK I'm building a program to controll serveral servos in an animatronic head I've made (Oooo fancy), now I know how to controll the servos via POTs and switches but I'm having an issue brining them together.
here's my code so far:
symbol jaw = 0
symbol right_cheek = 1
symbol left_cheek = 2
symbol right_eyebrow = 3
symbol left_eyebrow = 4
symbol left_eye_up_down = 5
symbol eyes_left_right = 6
symbol right_eye_up_down = 7
symbol analogport1 = 0
symbol analogport2 = 1
symbol analogport3 = 2
symbol analogport4 = 3
symbol analogport5 = 4
symbol analogvalue1 = w1
symbol analogvalue2 = w2
symbol analogvalue3 = w3
symbol analogvalue4 = w4
symbol analogvalue5 = w5
pause 1000
servo jaw,150
servo right_cheek,150
servo left_cheek,150
servo right_eyebrow,150
servo left_eyebrow,150
servo left_eye_up_down,150
servo right_eye_up_down,150
pause 1000
start:
if pin0 = 0 then servo left_eyebrow,150 Endif pin0 = 1
if pin0 = 0 then servo right_eyebrow,150 Endif pin0 = 1
if pin1 = 0 then servo left_cheek,150 Endif pin1 = 1
if pin1 = 0 then servo right_cheek,150 Endif pin0 = 1
if pin0 = 1 then servo left_eyebrow,75 Endif pin0 = 0
if pin0 = 1 then servo right_eyebrow,220 Endif pin0 = 0
if pin1 = 1 then servo left_cheek,80 Endif pin1 = 0
if pin1 = 1 then servo right_cheek,220 Endif pin0 = 0
readadc analogport1, analogvalue1
analogvalue1 = analogvalue1 *10/17+75
servopos left_eye_up_down, analogvalue1
readadc analogport1, analogvalue2
analogvalue2=170-analogvalue2
analogvalue2=analogvalue2 *10/17+75
servopos right_eye_up_down, analogvalue2
pause 1000
goto start
OK I've been having issues getting the readadc and pin commands to work together, they work fine if one set is deleted but when they are kept like the above code then the pin command works but not the readadc...
I doubt anybody can shine a bit of light on this for me? I've not done much programming at all (that may well show) so I'm learning as I go along.
Many thanks yet again and if you have any questions then please feel free to ask them and I'll get right back to you.
I'm sure there are posts relevent to this already online here but I'm not sure what to search to find them...
OK I'm building a program to controll serveral servos in an animatronic head I've made (Oooo fancy), now I know how to controll the servos via POTs and switches but I'm having an issue brining them together.
here's my code so far:
symbol jaw = 0
symbol right_cheek = 1
symbol left_cheek = 2
symbol right_eyebrow = 3
symbol left_eyebrow = 4
symbol left_eye_up_down = 5
symbol eyes_left_right = 6
symbol right_eye_up_down = 7
symbol analogport1 = 0
symbol analogport2 = 1
symbol analogport3 = 2
symbol analogport4 = 3
symbol analogport5 = 4
symbol analogvalue1 = w1
symbol analogvalue2 = w2
symbol analogvalue3 = w3
symbol analogvalue4 = w4
symbol analogvalue5 = w5
pause 1000
servo jaw,150
servo right_cheek,150
servo left_cheek,150
servo right_eyebrow,150
servo left_eyebrow,150
servo left_eye_up_down,150
servo right_eye_up_down,150
pause 1000
start:
if pin0 = 0 then servo left_eyebrow,150 Endif pin0 = 1
if pin0 = 0 then servo right_eyebrow,150 Endif pin0 = 1
if pin1 = 0 then servo left_cheek,150 Endif pin1 = 1
if pin1 = 0 then servo right_cheek,150 Endif pin0 = 1
if pin0 = 1 then servo left_eyebrow,75 Endif pin0 = 0
if pin0 = 1 then servo right_eyebrow,220 Endif pin0 = 0
if pin1 = 1 then servo left_cheek,80 Endif pin1 = 0
if pin1 = 1 then servo right_cheek,220 Endif pin0 = 0
readadc analogport1, analogvalue1
analogvalue1 = analogvalue1 *10/17+75
servopos left_eye_up_down, analogvalue1
readadc analogport1, analogvalue2
analogvalue2=170-analogvalue2
analogvalue2=analogvalue2 *10/17+75
servopos right_eye_up_down, analogvalue2
pause 1000
goto start
OK I've been having issues getting the readadc and pin commands to work together, they work fine if one set is deleted but when they are kept like the above code then the pin command works but not the readadc...
I doubt anybody can shine a bit of light on this for me? I've not done much programming at all (that may well show) so I'm learning as I go along.
Many thanks yet again and if you have any questions then please feel free to ask them and I'll get right back to you.