Announcement

Collapse
No announcement yet.

Newbie in Block Programming

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

  • Newbie in Block Programming

    I went through the tutorial and I cant figure out why my left motor is going in reverse when i use the gamepad, but the right motor is working fine. Sorry for this easy question. is there a a way I can post the picture somehow?

  • #2
    I am not sure about Block Programming but typically your motors are mirror images of each other on your bot. Often you have to reverse one of the motors in your coding by inserting a negative value usually when you set up the robot. Usually when referring to motor power.



    See that negative right before gamepad1? My guess is you would add a negative in the set motor1 power to tgtPower line as well. Probably right before tgtPower but as I said, I don't know anything about Blocks. I was actually looking through the sub-forum to find out more about it. In Android Studio you basically build the motors in another part of the program, set the power reversed there and never worry about it again. Not sure if that's how it works in Blocks...

    Hope this helps.

    To answer your second question, I post pics by uploading them to imgur then copy the direct link address there. Back at this site you put "[img]" then the website link you copied then "[/img]" but don't use the quotation marks. Always preview your post first since you can't edit it later. (At least, I can't)

    Comment


    • #3
      The recommended way of dealing with this is to use a Motor Direction block at the beginning of your op mode. That way you only have to do it once, not every time you get the value from the gamepad and not every time you set the power for the motor.

      Screen Shot 2017-02-05 at 3.43.09 PM.jpg

      Comment


      • #4
        Yup, that sounds like a good idea. Thanks for the clarification. I figured there was an initial place to set motor direction. I'm going to have a few sutdents test the Blocks method in the coming weeks and have them compare it to the Android Studio they are used to dealing with.

        Comment


        • #5
          Originally posted by FTC6180 View Post
          Yup, that sounds like a good idea. Thanks for the clarification. I figured there was an initial place to set motor direction. I'm going to have a few sutdents test the Blocks method in the coming weeks and have them compare it to the Android Studio they are used to dealing with.
          I would love to hear how that goes. I know that the Blocks programming mode is aimed at teams with less programming experience, but it has some advantages beyond just the graphical interface. For example, it's easy to update an opmode while the phone is connected to the robot. No need to unplug. Also, the turn-around time from when you modify an opmode to when you can test it is just a few seconds. No need to compile/build an app and reinstall it. Another advantage is that you don't need to install Android Studio. All you need is a browser. I've used an inexpensive Chromebook and it worked fine.

          Comment


          • #6
            Here is how to reverse a motor:

            Comment


            • #7
              Thanks for the response. That was a big help. We were able to get the motor running the right way and now are going to try to add two more motors to our programming.

              Comment


              • #8
                Originally posted by FTC6180 View Post
                Here is how to reverse a motor:
                Could this also be used to start the basis for an autonomous mode program?

                Comment


                • #9
                  I wouldn't think so just because you wouldn't be setting anything to the joysticks in autonomous mode. We are getting into that next week. I would recommend having it run for a certain amount of time or have it run using encoders. We are just trying this out for next year but I'll post a basic auto code next week if we get something decent up and running. Right now we haven't even figured out how to run more than 2 motors so we have a ways to go.

                  Comment


                  • #10
                    this is what we were able to do this weekend. maybe this will help.
                    [IMG]

                    Comment


                    • #11
                      this is what we came up with for a real quick autonomous mode. We just need a place to start and then just added and subtracted. its not real specific.but in the end we were able to modify and change things very quickly.
                      [IMG][/IMG]

                      Comment


                      • #12
                        We had the hardest time trying to figure out how to add more motors until we realized what we were doing wrong. To those new to programming in Blocks, you need to build and configure your robot first before you can start programming it. If you want to use 3 motor controllers and 6 motors, they have to be plugged into the motor controllers and those motor controllers need to be plugged into the Core Power Distribution Module. Once that is done, configure that set up by naming all the motors what makes sense to you then you "sync" it to the phone which makes them appear in the browser based Blocks programming environment. Same is true for any modules, sensors, servo, etc. You need to configure the robot in the phone and refresh your browser before you can start using them for programming. Seems obvious now but we kept thinking we were missing something since none of the sensors or motors were showing up in the "Blocks"

                        Comment

                        Working...
                        X