Hi. I'm new here and I'm not sure if this is the correct place to post this, sorry if it's not, but I appreciate your corrections.
Anyway, I have a problem with my project because the robot (2 motors) I control works fine when my code is like this
resp = object.function();
if (resp == -1)
but when looks like below, it doesn't work properly
if (object.function() == -1)
What I mean with that doesn't work properly is that at the beginning it works fine, but suddenly it fails
and I don't understand why. The only change between the proper behavior and the bad one is when I put my function within an IF statement.
I hope some of you can help me. thanks.
more details: object is an object of a class I created and the function return 0 or -1, but it takes some time.