Hello there, I’m new to the community but find myself coming here often! I am trying to get a Pixy Version 2.1 to talk to a photon for part of a senior project. I found the thread “Pixy2 connection to photon” and realized i was having the exact same error with this:
lib/Camera_Pixy2/ZumoBuzzer.cpp:5:27: avr/interrupt.h: No such file or directory
It seems as though the original poster of this error was able to work their way around it and i’m hoping i can be pointed in that direction.
Thanks in advance!
@Paddydukes, the code in ZumoBuzzer.cpp is hardware-specific for Arduino hardware, not Particle. If you want to play music or tones, you could extract code from the Particle InternetButton library. Searching the forum might also reveal code written by other members for this purpose.
Thanks @peekay123, I am really only interested in the Color of the object and its location in the field of view of the camera, no sounds needed!
The library that i need is much more minimal than the ones that I’m able to find from the previous “pixy2 connection to photon” thread.
My current plan of attack is to get the source code (of the “pixy2” library) from @ScruffR on github and remove what i don’t need and just have a private library. unless that seems like a terrible idea?
Thanks again for any help
@Paddydukes, I am assuming you are using the Color Connected Components mode of the Pixy2 where it will identify objects by seven (7) preset colors which you teach Pixy2 to identify. Take a look at the Pixy2 docs.
If you look at
ccc_hello_world.ino example of the library, you will find the
pixy.ccc.getBlocks() function and
pixy.ccc.numBlocks value. These will get you the blocks/objects detected by the pixy2 camera. You can then iterate through
pixy.ccc.numBlocks number of blocks to get its x,y location using
pixy.ccc.blocks[i].m_y. I believe the Pixy2
blocks mode (aka Color Connected Component) is the default mode. You can get the color of the block with
pixy.ccc.m_signature for each block, representing the (preset) color-code number.
Hope that help!
Here you are
This is the one from @ScruffR github.
It’s compiling fine but I didn’t tested. You can modify/remove/add whatever you want
Thanks for your input everyone, got it up and running and its doing what I was hoping it was going to do. The Pixy2 going to be mounted on a croquet wicket and will be used in conjunction with a laser break-beam sensor. The Pixy is way overkill for what I’m doing, but its fun to know that it will be much more accurate than the TCS3200 color sensor i was trying to use initially. And since learning is most of the point on this project so far so good! Thanks again for the assistance.