Announcement

Collapse
No announcement yet.

adding a 2nd joystick

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

  • TechnoHead
    replied
    Re: adding a 2nd joystick

    Re-booted system, and now it's in correct mode for editing.

    I'm not yet done with configuration, so I may still need some expert help from forum users. Pre-emptory thanks.

    Leave a comment:


  • TechnoHead
    replied
    Re: adding a 2nd joystick

    I'm trying to follow these instructions to get my second joystick working, but I'm somehow not able to click and drag the Joystick open icon onto the block diagram. When I click and drag nothing happens. When I click and then choose place, nothing happens. Before, I've been able to get things onto the block diagram, but now, I'm somehow locked out. All I get on the block diagram screen is the hand icon, or the circle with a line through it.

    I'm sure the solution is pretty simple, but could someone please tell me what to do?

    Thanks

    Leave a comment:


  • steinra
    replied
    Re: adding a 2nd joystick

    Excellent! Glad you were able to find the error. That text reference is always a bit tricky and has caught us in the past.

    Good luck at competition!

    Randy

    Leave a comment:


  • edwint
    replied
    Re: adding a 2nd joystick

    steinra,

    Thank you for your help. With your help, I located the problem. My code in the Begin.vi and Teleop.vi was the same, except for one invisible difference---an extra space in the name of "Joystick 2 " in the Teleop.vi. Once I removed the extra space after the "2", the second joystick now controls the arm motor.

    Again, THANKS for your help.

    Edwin

    Leave a comment:


  • steinra
    replied
    Re: adding a 2nd joystick

    teleop vi
    Attached Files

    Leave a comment:


  • steinra
    replied
    Re: adding a 2nd joystick

    Please see the attached images. It shows several screen shots of begin.vi and telop.vi. I added the vis as well.

    See second post for the telop.vi attachment
    Attached Files

    Leave a comment:


  • edwint
    replied
    Re: adding a 2nd joystick

    I've done that in the beginning and it does not work. I will try to post some images of my Begin.vi and Teleop.vi---if I can figure out how to use the INSERT IMAGE button.

    Leave a comment:


  • steinra
    replied
    Re: adding a 2nd joystick

    OK, I think I understand what is happening now. When you double click on the joystick block you are editing one instance of the joystick that is global for the system.

    What you need to do is on the terminals on the left of the joystick block, hover over them, there should be one labeled port and one labeled name (or something like that).

    Right click on the one labeled port and select "create a constant" from the menu. This will create a drop down next to the joystick open which allows you to select the USB port.

    Do the same thing on the name. This will create a little text box that you can enter the name you want to call the joystick.

    As soon as I get over to the school tonight I will post and example of what I mean.

    Thanks!

    Randy

    Leave a comment:


  • edwint
    replied
    Re: adding a 2nd joystick

    If I double-click on the SECOND Joystick OPEN (JOYSTICK2), the two USB parameters are set to USB1. However, the CONTROL I added to JOYSTICK2 is set to USB2. If I set the USB parameters to USB2 for JOYSTICK2, it also changes JOYSTICK1.

    Leave a comment:


  • steinra
    replied
    Re: adding a 2nd joystick

    There is a string passed into the open joystick command. It is another parameter like he USB 1 / USB 2. That needs to be unique for each joystick.

    I will try to post a screen shot later of what it should look like.

    Leave a comment:


  • edwint
    replied
    Re: adding a 2nd joystick

    I did add the joystick (joystick2) code to the Begin.vi, Teleop.vi and Finish.vis. Joystick2 is set to use USB2. Once this code is added, joystick one, which controls the Arcade Drive quits working.

    So, I tried moving to USB2 & 3---still nothing works. So, I purchased a new USB expander---still not working.

    Leave a comment:


  • steinra
    replied
    Re: adding a 2nd joystick

    Take a look at the begin.vi this is where the opens for all the devices are. You should be able to find a joystick open in this VI. Create a second one like it and name it joystick2 for the reference name or something like that.

    Now, back in robotmain.vi you can reference the second joystick and get values from it and send to the different motor controllers.

    Post if you are still having issues and will try to post a screen shot of what I am referring too here.

    Randy

    Leave a comment:


  • edwint
    replied
    Re: adding a 2nd joystick

    I'm in the same boat. I tried the NI.COM tutorial on "Basic motor control" and could not get it to work with joystick 2.

    Leave a comment:


  • iroliva
    replied
    Re: adding a 2nd joystick

    no i'm asking like how do you add it to the code. for instance we would like to use the 2nd joystick for a robotic arm. second how would you program the joystick to control a few different motors on each axis? for example motor 1 control the x axis while motor 2 and 3 control the y axis?

    thanks for replying guys your help is greatly appreciated

    Leave a comment:


  • jross
    replied
    Re: adding a 2nd joystick

    Originally posted by edwint View Post
    I was confused too. The checkout procedure from "Basic Operator Control" doc on page 2 of 3 has you confirm both Arcade and Tank Drive works. Tank requires both joysticks. I have only been able to get Arcade Drive to work.

    I must be missing something too. I think the default project provides for only Arcade drive. I will look into the code later tonight to verify.
    You are correct that the default project only has arcade drive. The documentation is incorrect when using LabVIEW in that case.

    Leave a comment:

Working...
X