<< return to Pixycam.com

Need request/response packets for pixy.init and pixy.changeProg

Hi edge,

I am writing a line following program for the Parallax Propeller 1 and have found that there are no request packets for pixy,init and pixy.changeProg in the Pixy2 Serial Protocol - Packet Reference Documentation.

Shouldn’t there be a changeProg(“line”) Packet Reference in the Line Tracking section of Pixy2 Serial Protocol - Packet Reference Documentation?

Would it be possible for you to provide those two packets in the sendPacket / requests sent to Pixy2 format?

As an example, my code for request version looks like this:

void pixy_request_version() {
clear_buffer();
fdserial_txChar(fdser5_4, ((0xAE) & 0xFF)); //16-bit sync
fdserial_txChar(fdser5_4, ((0xC1) & 0xFF)); //16-bit sync
fdserial_txChar(fdser5_4, ((0x0E) & 0xFF)); //Type of packet 14
fdserial_txChar(fdser5_4, ((0x00) & 0xFF)); //Length of payload 0
pixy_get_response();
extract_version();
}

Or:

int32_t pixy2_getVersion()
{
clearBuffer();

serial_txChar(pixy2, 0xAE);
serial_txChar(pixy2, 0xC1);
serial_txChar(pixy2, REQUEST_VERSION);
serial_txChar(pixy2, 0x00);

recvPacket();

if (validateChecksum() != RESULT_OK) {
return RESULT_CHECKSUM_ERROR;
}
else {
if (response[2] == RESPONSE_VERSION)
return RESULT_OK;
else
return (int32_t)(0xFFFFFF00 | response[2]);
}
}

The pixy.init will obviously not have a payload length, however the pixy.changeProg should have a payload length of 1 and a string “line_tracking”.

Regards,
TCIII

Bump?

So no one at Charmed Labs in the Software Development Section can respond to my request?

Regards,
TCIII

Hello,
It looks like we need to add this to the docs. In the meantime, this file is a good reference:

search for “changeProg”. It essentially details (in code) what is sent.

Hope this helps.

Edward

@edge,

Thanks for the response, much appreciated.

Regards,
TCIII