<< return to Pixycam.com

Pan Direction


#1

Hi,

Got the Pan/Tilt demo working but I’m using my own servos. Rather than following my object pixy avoids it and looks away from it. I need to reverse the direction of the Servo…is there an easy way to do this? :-/

Thanks,
Andy


#2

Hi Andy,

Are you using the Arduino pan/tilt demo or the Pixy-only pan/tilt demo?

Scott


#3

Hi Scott,

It performs the same using both demos. I will likely end up using the arduino in the end though.

Cheers,
Andy


#4

Figured this one out!

So, for anyone having this issue where the servo they are using is making the pixy actually run away from the object rather than follow it…

In the arduino pan/tilt example there is a line of code as follows:

m_pos += vel; (It’s in the void ServoLoop::update(int32_t error) loop).

Literally just change this to: m_pos -= vel; and it’ll start tracking properly!

Hope this proves helpful to anyone having issues.

Cheers,
Andy


#5

Hi Andrew,

Glad you were able to figure it out!

Scott


#6

this solution worked for me, and get my thumbs up


#7

That’s good news :+1: