Asked
— Edited

am using new mobile app on ios.what i notest is that the camera movement,
only goes all the way down or up or left and right.it doesn stop where you wanted.
am using new mobile app on ios.what i notest is that the camera movement,
only goes all the way down or up or left and right.it doesn stop where you wanted.
If I understand you right then this might help you and is something I use. Try scripting the mobile controls buttons a bit different to how you have them now...
Code:
What this will do is move the servo a small amount, so if you press it repeatedly the servo will move further.
The "D0>10" moves a servo on port zero to a position greater than 10 (setting can be anywhere between 1 and 180), and 10 being the limit minimum servo position and won't go under 10.
The "Servodown(D0,7)" section will move the servo 7 increments. The bigger the number, the further the servo will move (again, can be set between 1 and 180).
One button perss = small servo movement.
Many button presses = longer servo movement.
This way you will have more control over the servo that moves the camera. As the mobile interface control doesn't have a "When button is released" option due to different device limitations (unlike a joystick control) we have to script around it.
Hope this helps.
(assuming servos are connected to ports D0 and D1)
Camera looks "up" mobile button...
Code:
Camera looks "down" mobile button...
Code:
Camera looks "left" mobile button... (Depending on your point of view)
Code:
Camera looks "right" mobile button... (Depending on your point of view)
Code:
You can change the minimum and maximum servo limits and size of the servo increments to suit your needs.
But if you need to have a private chat, you can email me...
Steve.gibbs5@virgin.net
Steve.gibbs5@gmail.com
Email received.
#Servo move up
If(getservo(D9>140)
Servoup(D9,10)
Endif
Sleep(100)
and all the other directions to my project and get this
Start
2: If(getservo(D9>140)
> Error on line 2: Missing ) in Expression
Done (00:00:00.0170161)
what am I missing coz I can't get my old head around coding
if it is this line below, there was a missing brace....
If(getservo(D9>140)
should be
Code:
Yep, looks like Richard got it. That should get you fixed up.
Simply press the button direction that you would like to move the head. Press it again to stop moving.