So I got about 50 of these errors when I tried to compiled my code. It seems to only occur in lines where I reference an analogRead function, eg AccelAngle=analogRead(accelerometer);
Ive attached my entire code, if it helps. A full example of the problem is as follows:
for(i=0;i<=3;i++)
{
int VoltL,VoltR;
VoltL=analogRead(LLDR);//read
VoltR=analogRead(RLDR);//read
PrintVolt(VoltL,VoltR);
MotorCon(VoltL,VoltR);
delay(100);
}
The lines with VoltL and VoltR are getting the error I mentioned. Ive no idea how to rectify this. The code is for a 3pi Pololu robot, that carries out 3 basic tasks, for context
Any help, recommendations would be greatly appreciated!
The first line there im getting "FINAL:67: error: could not convert 'OrangutanMotors::setSpeeds(0, 0)' to 'bool'"
I never intended on this to be boolean or the sort? How can this be
Because you do motors.setSpeeds(0,0) in an if statement you check it for true or false. What do you try to do and what do you expect to get from motors.setSpeeds(0,0)?
Im trying to check to see if the motors ever stop moving, to then return a sound. Should a while statement be better in that case rather than if? It gives the same error regardless.
The task is to follow the light and when it gets close to the light, the light switches off and the robot should stop moving, and play a sound to signal completion. Is there perhaps a better way of doing that? motor.setSpeeds(10,10)
would set the left and right motors to a speed of 10, and a 0 would be a stop.
Dont suppose you'd have any idea on how to monitor the motor activity so that if they came to a stop, a sound is played? haha any help at all would be immensely appreciated
No ive no sensor to know if theyre turning or not. Im very much a beginner at this so im just running off the functions that ive come across from the respective libraries. Actually, im aware of how to monitor how long theyve been running, but thats far too messy for the task, and would need there to be no error in the final testing