Announcement

Collapse
No announcement yet.

Legacy Sonar Sensor

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

  • Legacy Sonar Sensor

    [MechE coach with software question, be gentle and use small words and simple commands...]

    Kids got some, but not all of the legacy sensors and new modern robotics sensors working today in basic form. Read values, spit out on telemetry.

    But not the legacy sonar. Some basic problems arise immediately:
    1) There isn't an option to select a sonar/distance legacy sensor in the configuration menu on the phone.
    2) I'm not sure they're using the ultrasonic class correctly.

    Can anybody post an explanation of #1 and a code snipped regarding #2 so I can get them going again?

    Thanks much

  • #2
    I've been trying to figure this out for a while. All I know is that you can only use the last 2 ports, but only if those are set to 9v mode. Can't find how you set it to 9v mode - might be a programming thing. This is what ModernRobotics says about it: "Each Legacy Module port can operate in digital as well as analog modes. In digital mode, legacy connector pins 5 and 6 can be set to logic 0 or logic 1.
    In analog mode, the voltage on legacy connector pin 1 is measured using a 10 bit analog to digital converter. Additionally, pins 5 and 6 can be set to logic 0 or logic 1 for control of the attached device, such as a LEGO light sensor which uses pin 5 to turn the sensor LED on and off."

    I know that it's possible, but either nobody has figured it out yet or it's something very obvious that we've missed.

    Comment


    • #3
      What do you mean "last two ports?" Doesn't the term "pins 5 and 6" refer to the pins present on each port?

      Comment


      • #4
        Yeah, there are port 0-5, so ports 4 and 5 are what ultrasonic sensors use. Yes, the part about the ports isn't mentioned in that snippet I provided. It's in this snippet, taken from the same source as before:

        "In I2C mode, legacy connector pins 5 and 6 are used to communicate with I2C devices in accordance with the LEGO interpretation of I2C. Ports 4 and 5 can additionally be switched into pin 1 9v supply mode to permit LEGO ultrasonic range sensors to be used."

        Comment


        • #5
          Well Ok then. Now I am just as lost as you. But then as you can see from my first question (1) in the original post. Ultrasonic sensor was not even an option the kids could find when configuring the sensor and other connections on the phone. Perhaps they actually needed to have the US sensor in port 4 or 5?

          Confused...

          Comment


          • #6
            I have the same problem, which is why I think it's programming related. It's possible to declare something in the configuration in the code, at least controllers. But even with the sensors in the ports I couldn't detect anything. I'm not all that great with programming, so I haven't really tried much on that front, but maybe you guys could trial-and-error something. Feel free to try it yourself, the more the merrier! I'm very curious to see how we can actually get these sensors to work.

            Comment


            • #7
              Originally posted by zain View Post
              [MechE coach with software question, be gentle and use small words and simple commands...]

              Kids got some, but not all of the legacy sensors and new modern robotics sensors working today in basic form. Read values, spit out on telemetry.

              But not the legacy sonar. Some basic problems arise immediately:
              1) There isn't an option to select a sonar/distance legacy sensor in the configuration menu on the phone.
              2) I'm not sure they're using the ultrasonic class correctly.

              Can anybody post an explanation of #1 and a code snipped regarding #2 so I can get them going again?

              Thanks much
              Zain - the support for the legacy ultrasonic sensor is scheduled to be released this week.

              Comment


              • #8
                Cool thanks Tom. Any other sensors newly supported with this release?

                Comment


                • #9
                  From http://ftcforum.usfirst.org/showthre...6954#post16954
                  It will have support for the color sensors, the legacy NXT ultrasonic sensor, and some other changes.

                  Comment


                  • #10
                    Missed that other thread... thanks. Continuing with the dumb questions so I don't look clueless when the kids ask as the updates arrive:

                    - I presume we update the apps on each of the phones (via the Play Store?), and download an updated file set from github, move their code over and compile/download and that's it?

                    Comment


                    • #11
                      You'll have to update the Driver Station from the Play Store if it changes, but it won't necessarily just because the SDK is updated. If you are building the Robot Controller app from Android Studio, there is no need to update it from Google Play, just pull/clone from GitHub and re-build it. If you have just been using the Robot Controller app from the Play Store, you should update it from there.

                      Comment

                      Working...
                      X