<< return to Pixycam.com

Pixy Coordinates

I’m having problems with x,y coordinates from Pixy. Hello World runs perfectly well as does one of my programs. But after I added some more code things began to behave weirdly. The blocks from Pixy always look good just as they do in Hello World. But immediately after picking up the y coordinate and executing a little math on it, it turns in to garbage or some very high or low number. Other variables become corrupt also like “leftLimit” & “rightLimit”. And the weirdness is that there are times but infrequent when some of these variables may appear good. The source code is below; the first source behaves very well but not the second where you’ll see I have added code. But for the life of me I can’t see anything wrong with the code. However I’m not well versed in C. My only concern here is with the y coordinate that is captured in a variable called “moveNumber”. So don’t concern yourself with any motors or their behavior. They work very well when given the appropriate command.
Thanks,
Paul

I’m having problems inserting code. I’ll try later. But on another forum some suggested I may be running out of memory. may explain some odd behaviors so I will address the memory issue and then return here again later if need be.

Thanks!

Well finally got it working. After scaling back my code it began working! I suppose it was a memory issue. My compile showed that I was well under 50% for both program space & variable space. So I’m not quite sure where all the memory is going. Is it possible that the Pixy Library could be using much more memory than I’m aware of?

I basically replicated what Jacky did on another post here just to better acquaint myself with Pixy. Thanks Jacky!!
Here it is in action…
[[https://www.youtube.com/watch?v=MMy7-Coidoc&feature=youtu.be]]

Paul

Hello Paul,
Thanks for the video! Very cool!

The Pixy Arduino library doesn’t use much memory. Maybe about 128 bytes. I’m confused as well. Are you using an Arduino?

Edward

Yes, I’m using the Arduino Uno. Could it be my use of the AccelStepper Library?

Hello Paul,
Perhaps, but I’m not familiar with that library.

Edward