I need help! I have made 3 toggles that function very well one for snags and a claw however these motors get too hot after 2 minutes I have so far tried to just spin to position instead of just spin but nothing works they still get hot.
Ah, well, it means opposite. So when the motor isn’t at -187; run the code. Such as !True == False.
I haven’t programmed any robotics for a while, and don’t really use C++. Well, I prefer Python, but am using another program which acts a lot like C++, so I’m not really sure what will work. I just though I’d give an example.
I assume you mean to their starting positions, that should be at 0 degrees - I think, because 0 is starting degree no matter the angle the motor starts at.
To fix that issue, what you can do is start the movement and only send that command once. You can do that by setting the waitForCompletion flag to false. This will make it so that the motor command will run independently and will not hold up the rest of the thread. You also need to make sure that it won’t keep running it. You can do this with the buttonUpPressed variable that you have already created. This will make it so that it will only send the spinToPosition command once when you press the button. Your code should look something like this.