Announcement

Collapse
No announcement yet.

VEX Limit Switch not working with DIM

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

  • VEX Limit Switch not working with DIM

    I have been trying to get the VEX limit switch to work with the Device Interface Module, but can't get it to work. I plug it into a digital port correctly and configure everything, and I have tried different wires and different limit switches, but none seem to work. Here is the part of the code that is relevant:

    DigitalChannel limit;
    boolean limitState;
    public void init() {
    limit = hardwareMap.digitalChannel.get("limit");
    }
    public void loop() {
    limitState = limit.getState();
    telemetry.addData("LimitState", limitState);
    }

    Whenever I plug in the MR Touch Sensor and use the same program, it works perfectly. However, the limit switch does not. Is there any particular reason for this, or am I just doing something wrong? Thanks!
    Programmer for Team 4997 Masquerade -- 2012 World Champions, 2014 - 2016 Division Finalists
    Founding Member of Team 6433 Neutrinos -- 2015 World Champions

    Check out my intro video to the new tech platform
    Check out my team's Robot Reveal for Res-Q

  • #2
    Originally posted by Varun Singh View Post
    I have been trying to get the VEX limit switch to work with the Device Interface Module, but can't get it to work. I plug it into a digital port correctly and configure everything, and I have tried different wires and different limit switches, but none seem to work. Here is the part of the code that is relevant:

    DigitalChannel limit;
    boolean limitState;
    public void init() {
    limit = hardwareMap.digitalChannel.get("limit");
    }
    public void loop() {
    limitState = limit.getState();
    telemetry.addData("LimitState", limitState);
    }

    Whenever I plug in the MR Touch Sensor and use the same program, it works perfectly. However, the limit switch does not. Is there any particular reason for this, or am I just doing something wrong? Thanks!
    Perhaps the MR Touch Sensor has an internal pull-up resistor.
    If there is no pull-up on the Dig In pin inside the DIM then a simple switch to ground won't change the level.

    Does it always report low or false?

    Phil.

    Comment


    • #3
      I happened to be messing with a VEX limit switch last week with an Arduino and found that it definitely needed a pull-up resistor. I doubt that there are pull-up resistors in the DIM because there is no way to change their state in the SDK and it is rare to not have an option for no pull-up resistor.

      Comment


      • #4
        How would I install said pull-up resistor? Also what resistance value do you recommend? Thanks!
        Programmer for Team 4997 Masquerade -- 2012 World Champions, 2014 - 2016 Division Finalists
        Founding Member of Team 6433 Neutrinos -- 2015 World Champions

        Check out my intro video to the new tech platform
        Check out my team's Robot Reveal for Res-Q

        Comment


        • #5
          Well, according to the forum rulings, it isn't legal to do that.

          Comment


          • #6
            This forum ruling allows for pull-up resistors, as it is a passive component.
            http://ftcforum.usfirst.org/showthre...ll=1#post18114

            I don't know what resistance to use though and exactly how I should install it.
            Programmer for Team 4997 Masquerade -- 2012 World Champions, 2014 - 2016 Division Finalists
            Founding Member of Team 6433 Neutrinos -- 2015 World Champions

            Check out my intro video to the new tech platform
            Check out my team's Robot Reveal for Res-Q

            Comment


            • #7
              Here is a diagram of a pull-up resistor circuit (replace "button" with your sensor, connected to signal and ground). I would use something on the order of 1-10 kΩ. I am not sure whether a pull-up resistor really counts as "passive" since it is doing more than uniformly adjusting voltage levels, but you're welcome to interpret it however you want.

              Comment


              • #8
                Thank you Philbot and GearTicks! I got the sensor to work after using a pull-up resistor (I used a 1.5 kΩ resistor).
                Programmer for Team 4997 Masquerade -- 2012 World Champions, 2014 - 2016 Division Finalists
                Founding Member of Team 6433 Neutrinos -- 2015 World Champions

                Check out my intro video to the new tech platform
                Check out my team's Robot Reveal for Res-Q

                Comment

                Working...
                X