I was trying to work on printing to the V5 controller and I was encountering problems with strings. I put some code below.
class printingclass
{
private:
std::string partone;
std::string parttwo;
void findscreenpart ()
{
if(screen == 1)
{
partone = "Socks";
}
if(screen == 2)
{
partone = "Jacket";
}
if(screen == 3)
{
partone = "Shorts";
}
if(screen == 4)
{
partone = "Pants";
}
}
void findcolorpart ()
{
if(colorfocus == 1)
{
parttwo = "Blue";
}
if(colorfocus == 2)
{
parttwo = "Yellow";
}
if(colorfocus == 3)
{
parttwo = "Red";
}
if(colorfocus == 4)
{
parttwo = "Nothing";
}
}
public:
void printbasicmenu ()
{
findcolorpart();
findscreenpart();
controller2.Screen.clearScreen();
controller2.Screen.setCursor(1,1);
controller2.Screen.print(partone + " : " + parttwo);
}
};
Unfortunately, VexCode does not like the part at the end
controller2.Screen.print(partone + " : " + parttwo);
Will the V5 controller only print if you are using some sort of integer? I have seen some threads with stuff similar to
controller2.Screen.print("Result = %d", 5);
But that wasn’t exactly what I was hoping for. It seems to be what VexCode wants from what I see in the console about the error.