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