Announcement

Collapse
No announcement yet.

HELP --- Motor Power Code not working --- MIT App Inventor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HELP --- Motor Power Code not working --- MIT App Inventor

    We are having issues with our blocks for using a bumper to move a motor forward and backward. Here is a picture of our blocks https://goo.gl/X0VhYa If anyone has any ideas, they would be greatly appreciated. We are having to use one controller for this weekend due to many members taking the SAT.

    Thanks

  • #2
    You can't assign a string to a direction. You should use Direction_REVERSE instead. Also, in your code, depending on which bumpers are pressed, it is possible that you will assign the motor "spinner" a power two or three times in the loop. I think you want something like:
    Code:
    if FtcGamepad1.RightBumper
      then set spinner.Power to 1
    else if FtcGamepad1.LeftBumper
      then set spinner.Power to -1
    else
      set spinner.Power to 0

    Comment


    • #3
      Hi FTC7785,

      I agree with GearTicks. I think you want to use the enumerated "Direction_REVERSE" value that is available with the DcMotor object in App Inventor. Please take a look at the following screen shot for an example of how to reverse the direction of a DC motor.



      Tom

      Comment


      • #4
        I've moved this thread to the App Inventor subforum.

        Comment

        Working...
        X