Hi
I am recently doing a projet with pixy2 and STM32. I would like get datas back to my STM32 from pixy2 using I2c. But the code you provided didnt work with my STM32. I’ve set the I2c communication with pixymon on my PC and connected the STM32 and pixy2 as told in the web. I can get the pixy2 address 0X54 bying using I2c scanner but just cant get the datas back to my STM32. it ssems the pixy.init() is blocking the code from running. Here is my code
#include <Pixy2I2C.h>
Pixy2I2C pixy;
#include <Wire.h> //Include the Wire.h library so we can communicate with the pixy2.
TwoWire WIRE2 (2, I2C_FAST_MODE); //Initiate I2C port 2 at 400kHz.
#define Wire WIRE2
void setup()
{
Serial.begin(115200);
Serial.print(“Starting…\n”);
Wire.begin();
pixy.init();
}
void loop()
{
int i;
// grab blocks!
pixy.ccc.getBlocks();
// If there are detect blocks, print them!
if (pixy.ccc.numBlocks)
{
Serial.print("Detected ");
Serial.println(pixy.ccc.numBlocks);
for (i=0; i<pixy.ccc.numBlocks; i++)
{
Serial.print(" block ");
Serial.print(i);
Serial.print(": ");
pixy.ccc.blocks[i].print();
}
}
}
I will be very greatful if you can find the solution. Thank you very much.