Hello,
I am using a Pixy2 cam connected to an Arduino via SPI on my hexapod. Servos are connected to the Pixy2 board. I run a modified Arduino pan/tilt code but the Pixy2 head crashes into the front legs in max/min pan position.
I can limit the pan servo in Pixymon while running pan/tilt demo but with Arduino connected the limits do not work. I suppose they need to be set in the Arduino sketch.
The topic Pixy2 Pan/Tilt How to Limit Servo's range of movement did not provide a solution for me.
In TPixy2.h I found:
// RC-servo values
#define PIXY_RCS_MIN_POS 0
#define PIXY_RCS_MAX_POS 1000L
#define PIXY_RCS_CENTER_POS ((PIXY_RCS_MAX_POS-PIXY_RCS_MIN_POS)/2)
Is this the right place to set the limits? How can I set values for each servo separately?
I cannot find a solution for my problem here:
https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:general_api
Can you give me an example of Arduino code how to set the pan/tilt limits?
Thanks for your help!
Markus