<< return to Pixycam.com

Controlling Motors by Identified Object using Pixy 1

Hello,

How can I rotate specific motors based on what the Pixy sees? For example, if it sees yellow, one motor rotates and if it sees red then another motor rotates.

Thanks

Hi,

you can access the pixy.ccc.blocks[i].m_signature value that Pixy returns, which contains the color signature number it sees. Then write some if statements to rotate the motors, based on this value.

More info here: https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:hooking_up_pixy_to_a_microcontroller_-28like_an_arduino-29#arduino-api

Cheers,
Jesse