<< return to Pixycam.com

Library error (Pixy2CCC.h) / Error messages when compiling Arduino sketch

Dear Pixy2 developers!

I’m trying to use Pixy2 for a fetch robot.
https://forum.arduino.cc/index.php?topic=672547.0

However, when compiling the sketch I get:

In file included from /home/…/fetch_robot_pixy_servo_v3/fetch_robot_pixy_servo_v3.ino:2:0:
/root/Arduino/libraries/Pixy2/Pixy2CCC.h: In member function ‘int8_t Pixy2CCC::getBlocks(bool, uint8_t, uint8_t)’:
/root/Arduino/libraries/Pixy2/Pixy2CCC.h:124:32: error: ‘PIXY_TYPE_RESPONSE_ERROR’ was not declared in this scope
else if (m_pixy->m_type==PIXY_TYPE_RESPONSE_ERROR)

So I manually declared those variables in Pixy2CCC.h. But not sure, if this is the way tho solve this problem.

Any help greatly appreciated.
Thank you!

Hmmm…perhaps @edge can decipher this?

Hello,
It looks like you need to include “Pixy2.h”, which includes all other files including pixy2CCC.h, etc.

Edward

Hi Edward,
“Pixy2.h” was always included in the sketch.

That’s odd…

So Pixy2.h includes TPixy2.h which has the #define for PIXY_TYPE_RESPONSE_ERROR.

Something isn’t quite right…

You might reinstall the Pixy2 Arduino library.

Edward

I re-installed the libraries and tried to compile an empty sketch.
On Linux (Arch) I get the same error message.
On Windows it’s a little different.

Ah, by including the files like you have, it messes with the “include once” #defines.

Just use 1 include statement:

#include “Pixy2.h”

Look at the ccc_hello_world example if you need an example.

Edward