Invalid operands to binary expression

#1

Using VCS to create a deadzone and throttle curve for a motor.
Not sure what the error means.

invalid%20operands%20to%20binary%20expression

0 Likes

#2

Not quite sure, but try making 100 a float, since leftDriveValue is a float.

0 Likes

#3

do you mean 100.0?

I did that. Same error.

0 Likes

#4

Yeah I’m not sure then. Could be something with the operator there, but I don’t think it is.

@jpearman would you have any ideas?

0 Likes

#5

well, what I assume what you want is raised to power 3, which would be

  leftDriveValue = pow( (leftDriveValue/100), 3.0 );

the ^ operator is binary XOR

1 Like

#6

Ah that makes sense.

0 Likes

#7

To add on to what @jpearman was saying, there exist many places online where you can find what various operators do in C/C++, like Wikipedia.

1 Like

#8

Got it. Thanks guys.

0 Likes