<< return to Pixycam.com

Time for pixy2 to switch from line following to color detection with arduino

Hi!

How long time does it take for pixy2 itself to switch program from linefollowing program to color_connected_components? I am using an arduino and whant to be able to do this but have noticed that the pixy2 can’t change program Instantly, it takes some time but I don’t know exactly how. I whant the time as short as possible but need it to hav enough time to change program

I know that I have to put some delay in to the code but don’t know how much, do you have any recomendations?

I whant the code to look something like this:

void loop(){

pixy.changeProg (“line”);
delay**(X-milliseconds);**
pixy.line.getMainFeatures* ();
a = pixy.line.getMainFeatures()->m_x;
pixy.changeProg(“color_connected_components”);
delay**(X-milliseconds);**
pixy.ccc.getBlocks();
if (pixy.ccc.numBlocks)
{
i++;
}

}

Hello,
You don’t need to put a delay in your code as changeProg will block. Having said that, it does take some time to switch programs (about 100ms).

Edward

Hi!

Ok, thank you! I will try without and see then.