Hello,
the problem is that there is no library for pixy2 on LabVIEW, so i have to use the Arduino as a middle-man to get the connection, as i have found a library for Arduino on LabVIEW.
there is only a library for Rio.
so the best way is to get this that way, unless you can provide me an other solution or a library for LabVIEW and Pixy2.
if i want to connect the Arduino with LabView it has to be by an COM Port and i allready succeed, this my problem is that on the LabVIEW if i want to call the Pixy through Arduino, i can’t because it is connected with the supplied cable through ICSP port, and i can only choose on LabVIEW the Pins nummbers, no ports so i can’t conntact the Pixy2 because it is connected to ICSP.
but u told me i can connect it by UART so through the Pins on Arduino, this way i can make the commands on LabVIEW through the Arduino to the Pixy2, right?
but which Pins can provide me the X and Y information that i need?
i have seen on the links that i have to read the date from the TX Pin, is this right?
i wrote this code for the Arduino, is this ok too?
#include <Pixy2UART.h>
Pixy2UART pixy;
void setup()
{
Serial.begin(115200);
Serial.print(“Starting…\n”);
pixy.init();
}
void loop()
{
int i;
// Daten von der Pixy2-Kamera abrufen
pixy.ccc.getBlocks();
// Wenn Blöcke erkannt wurden, sende sie über die serielle Schnittstelle an LabVIEW
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(": ");
Serial.print("X: ");
Serial.print(pixy.ccc.blocks[i].m_x);
Serial.print(" Y: ");
Serial.println(pixy.ccc.blocks[i].m_y);
}
}
}