OK, helping the kids and I noticed this little slip up in the code and I’m wondering why it even compiled. The button is on one of the digital ports configured in the window, not via coded commands if that makes a difference. Back using RobotC v3.04 too.
Here’s the line of code in question:
while( SensorValue**(frontButton)** != 1)
{
//wait a bit… this code is not important to this post…
}
It should be:
while( SensorValue****frontButton**]** != 1)
{
//wait a bit… this code is not important to this post…
}
Why would SensorValue looking like a function reference versus an array offset even compile? It did not act the way we would have liked so that’s why we stumbled upon it.
I saw in some search that SenosorValue as a function from an NXT post but nothing for Vex Cortex that way.
Thanks!