Can anyone please help me by showing me how to add extra barcodes to pixy line prog. I left and right turns but would like to add the other barcodes from no. 1 to 15 but cannot get this to work have trised and tried different ways but no luck please help me Mike
Hello Michael,
The demo use codes 0 and 5 â hereâs the complete program for reference:
But in particular, the important lines:
if (pixy.line.barcodes->m_code==0)
pixy.line.setNextTurn(90); // 90 degrees is a left turn
// code==5 is our right-turn sign
else if (pixy.line.barcodes->m_code==5)
pixy.line.setNextTurn(-90); // -90 is a right turn
To add new codes, you need to print out different codes and add them to your code â for example hereâs what a âstopâ code might look lke:
if (pixy.line.barcodes->m_code==1) // stop
{
motors.setLeftSpeed(0);
motors.setRightSpeed(0);
}
The codes can be found here (or via the downloads page):
The barcodes can be printed out as-is, or you can add artwork to them to make them human-readable as well.
Hope this helps!
Edward
Thanks for helping Edward I have tried adding your new code but I am getting error---- class Zumo Motors has no member named set âdo you have any idea why I get this Mike
Still no luck with extra barcodes allI get is error message have tried for hours Mike
Hello Michael,
Copy the exact error youâre getting in your message.
It itâs saying âno member named setâ, it would be because there is no member named âsetâ. The code I suggested called âsetLeftSpeedâ and âsetRightSpeedâ. But my code wasnât intended as an exact set of instructions. How is your C programming? It sounds like you might be struggling with the C language.
Edward
Hi Edward
The error message reads âclass Zumo Motorsâ has no member named âsetâ does this help
Mike
Well, I agree with the compiler that class ZumoMotors has no member named âsetâ.
This isnât a particularly difficult error to track down, which is why I asked you about your C programming. You might have a friend or colleague who knows C take a look at your code.
Edward
Thanks for trying to help I am very new to this and I thaught I would be able to use this without helpas I do not no very much about codes but it looks like I will not be able to use these extra codes.
Mike