Motors only spins forward

So my team is new to programming and we are trying to create our custom driver control for our robot since it has a flywheel and we are trying to have the led work. For some reason we can spin our motors forward but not in reverse.

Can you post your code please. Put three back ticks ` in the front and three in the back so it formats on the page correctly.

Make sure you make the dinstice negitive not the the speed.

‘’’Screenshot 2022-01-27 9.51.27 AM ‘’’
‘’’Screenshot 2022-01-27 9.51.02 AM ‘’’
‘’’Screenshot 2022-01-27 9.50.52 AM ‘’’
‘’’

‘’’

‘’’Screenshot 2022-01-27 9.57.14 AM ‘’’

I see. You have two states for each button - start and stop. In actuality you need three states - forward, reverse, and stop.

What is happening is that when you press the forward button it tells the motor to go forward but the non-pressed reverse button is still telling it to stop.

Using If, else if, else provides you three modes or states that control one motor.

image

A few other points.

  • The torque and speed can only go to 100%.
  • You only need to Set Stopping to Hold one time at the top before the forever (unless you change it elsewhere).
2 Likes

I would also suggest using c++ as your program because it gives error messages and is more customizable

I would highly suggest that you not do this unless you are currently a fluent C++ programmer. Trying to learn C++ and the robot API at the end of the season is a recipe for disaster.

3 Likes