Announcement

Collapse
No announcement yet.

Motors won't run

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

  • Motors won't run

    We are a new team this year and we setup our phones and hub today. After a few issues, we were finally able to upload the Android Software OpMode file to the Robot controller. We hooked up the game pad and after we press the INIT button and the play button, we can see some data on the Robot Controller with numbers moving up and down when the joystick is pushed up or down. We do not see any telemetry on the Drive Station and the motors don't move. We don't know if this is an issue with the code used in Android Studio or the configuation of the phone. I have attached the code used for our DriveTeleOp. Any ideas?
    Attached Files

  • #2
    It sounds like an issue with the wiring to your motors. Check that the motors are connected to the ports which correspond to the ones in your configuration.

    Comment


    • #3
      Yes I checked that the motors are wired and named correctly. I was able to get the robot to run using the Blocks programming software, but not the Android software.

      Comment


      • #4
        Are you getting a clean build & install? I just noticed the last line in your loop() method is:

        Code:
        telemetry.update (;)
        The semi-colon needs to go after the parentheses.

        Comment


        • #5
          Are you saying to update that in the actual file and then try uploading it again?

          Comment


          • #6
            Yes - fix that line in Android Studio & then re-build your project (press the green triangle at the top of the AS screen).

            Watch the messages at the very bottom of the AS screen - it should build for a while, then make sure you get a message that it is "installing apk" and then "launching activity". At that point you can unplug the phone from your computer. The new app should be installed & ready for you to test again.

            Comment


            • #7
              Originally posted by FLARE View Post
              Are you getting a clean build & install? I just noticed the last line in your loop() method is:

              Code:
              telemetry.update (;)
              The semi-colon needs to go after the parentheses.
              It's not just that, the telemetry.update() line shouldn't exist at all. It's an OpMode, not a LinearOpMode. The OpMode classes all call telemetry.update() implicitly at the end of every call to the loop() method and since the mode of the "Auto clear" is set, that second call to telemetry.update() wipes out the cache from the first call. So, what happens is that they're calling telemetry.update() and it sends stuff out, but then the loop() method terminates and the system is calling another update() within femtoseconds which wipes out the data. If they remove the telemetry.update() entirely, they should at least be able to see the telemetry data each time to be able to figure out what's up.

              -- Gordon.

              Comment

              Working...
              X