Asked — Edited

Camera Folowing Movement Using Horizontal Servo

So I have a Camera mounted on a Ping Sensor mounted on a horizontal servo. I tried several existing scripts but could not get the servo to move The servo in on D0 and the Ping is on D21. So what is suppose to happen is if the object is with in a given ping distance, then the camera will turn to view the object and the servo will track the object until the object leaves the ping field at this point the servo goes to center. Any one have any scripts to do that they would be willing to donate Appreciate it Thanks


ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

PRO
Synthiam
#1  

The ping is on D21 and what else? The ping requires two ports, one for ECHO and one for TRIGGER.

#2  

D20 for the ping D21 for the Echo

#3  

I do see the ping working and the camera is working and the servo did center

#4  

I did enable tracking type of Motion on the camera I enabled servo Tracking and assigned D0 to X axis, nada tried y axis nada RotateNoneFlip None So Im missing something

PRO
Synthiam
#5  

yeah - you're missing performing any of the activity tutorials.:)

Do this...

  1. Load ARC

  2. Press Project -> Add Control -> Scripting -> EZ-Script

  3. Press the gear icon on the EZ-Script control

  4. Paste in this code


:loop

$ping = getping(d20, d21)

IF ($ping < 20)
  Servo(d0, 10)
ENDIF

sleep(500)

goto(loop)

  1. Save the script

  2. Run the script by pressing the start button

You can find activities in the learn section which will explain how to program and demonstrate how controls work. Press the ? (question mark) on any control to read about it. The CAMERA CONTROL is a good place for you to start using the question mark. Also, there are MANY tutorials in each control

#6  

Yea done some of those but they talk about individual actions for individual devices, when it comes to inter-migration between the different devices I have not found much. thanks anyway