Go to Post If you ever find yourself thinking that you are the most brilliant person in a situation, you are doing something wrong. - EricVanWyk [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-12-2008, 23:05
jmanela's Avatar
jmanela jmanela is offline
+1 is BIGGER than -1
AKA: Joshua Manela
FRC #2586 (Fondy Fire)
Team Role: College Student
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Michigan
Posts: 314
jmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to behold
USB input controller how to.

How would you program a usb controller into labview. I know which vi's to use, but I don't know which values the usb is in the driver's station.
Reply With Quote
  #2   Spotlight this post!  
Unread 29-12-2008, 11:44
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: USB input controller how to.

It isn't clear what it is you are attempting to do. I think you are trying to read a joystick on the PC. In that case, you will be using the Input Device Control VIs. I think the primary question is how to use the device number input.

This number is determined by the OS when the OS discovers the devices plugged into the USB bus. If devices are plugged in when you run your program, you can often hard code the number, but this will not travel well to other computers, and will have issues when the joysticks are plugged in after running, etc.

The way to use this is to run the VI Query Input Devices. For fun, you can open and run it interactive. It will produce an array of info about the joysticks and other devices. This will sometimes be surprising as laptops will often list a joystick even when one isn't plugged in. This is because they can have an HID device that is actually a specialized joystick, or they can have a BT bridge device that supports both mouse and a joystick. The joystick may not be there at the moment, but since it can show up when BT is ready, they declare it early.

Anyway, the device index to use is the index into the array returned by the Query call. If doing this interactively, you may want to list the items into a listbox and let the user select from the joysticks. More likely, you want to search the array for the device name looking for the mfg name you expect in the array.

If I'm way off on what you are asking, please try again.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 29-12-2008, 12:06
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Re: USB input controller how to.

Actually, I think he's trying to deal with a Joystick attached to the DS. If this is the case, you simply use the Open Joystick, and Get Axis VIs provided with WPILib. You feed it the USB port its plugged into on the DS (USB1-4), and the Axis off the joystick (i believe its Axis 1 = X, Axis 2 = Y).
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2009, 11:59
rogerlsmith's Avatar
rogerlsmith rogerlsmith is offline
Software Engineer
AKA: Roger Smith
FRC #3357 (COMETS)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Grand Rapids, MI
Posts: 214
rogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to behold
Re: USB input controller how to.

Is anyone trying to connect a USB keypad/numpad to the DriverStation? I picked up a Targus two port numeric keypad and we are not getting much info from it. We are programming in C/C++ and tried getting raw button data (as if it were a joystick) and weren't able to read anything. Although as we typed on the keypad, it did make strange characters appear on the DriverStation.

If anyone has any info on connecting something like this, I'd certainly appreciate a few clues.

Thanks,
Roger
__________________
Roger Smith
Mentor - FRC Team 3357
COMETS - Creating Outstanding Minds, Embracing Technology & Science
---------------------------------------------------------------------------------------

Share FIRST videos, photos and experiences at FIRSTObjective.org
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2009, 15:39
mjcoss mjcoss is offline
Registered User
FRC #0303
 
Join Date: Jan 2009
Location: Bridgewater,NJ
Posts: 70
mjcoss is a jewel in the roughmjcoss is a jewel in the roughmjcoss is a jewel in the roughmjcoss is a jewel in the rough
Re: USB input controller how to.

The first issue is: does the Linux system that is running on the driver station recognize the controller. If it has a driver that recognizes the controller, then you need to figure out how the system has mapped that interface to the joystick buttons. I'd hook up a hyperterminal to the serial port, put a loop in the C code print all the button values, and see if you're getting anything.

I attached a Microsoft USB steering wheel and it recognized it although the centering didn't work. Note that in this case the device is pretty similar to a joystick.
Reply With Quote
  #6   Spotlight this post!  
Unread 15-01-2009, 16:44
keen101's Avatar
keen101 keen101 is offline
Ubuntu Linux User
no team
Team Role: College Student
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Loveland, CO
Posts: 228
keen101 is a jewel in the roughkeen101 is a jewel in the roughkeen101 is a jewel in the roughkeen101 is a jewel in the rough
Re: USB input controller how to.

The usb device has to be HID compliant. That means if you plug it onto a Windows or MAC or Linux system and it works without needing to install drivers it will most likely work on the DS.

I have a SNES controller that i turned into a USB joystick with an AVR microcontroller, which is now a low speed usb 1.0 HID joystick, which i am just itching to try with the DS.
Reply With Quote
  #7   Spotlight this post!  
Unread 15-01-2009, 16:53
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: USB input controller how to.

Quote:
Originally Posted by keen101 View Post
I have a SNES controller that i turned into a USB joystick with an AVR microcontroller, which is now a low speed usb 1.0 HID joystick, which i am just itching to try with the DS.
Very cool!

Sounds like the perfect topic for a white paper. I inherited some code to turn a PIC18 (or was it 16?) into an HID joystick. I just don't have the time right now to polish it for release.
Reply With Quote
  #8   Spotlight this post!  
Unread 15-01-2009, 16:58
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: USB input controller how to.

Quote:
Originally Posted by rogerlsmith View Post
I picked up a Targus two port numeric keypad and we are not getting much info from it. We are programming in C/C++ and tried getting raw button data (as if it were a joystick) and weren't able to read anything. Although as we typed on the keypad, it did make strange characters appear on the DriverStation.
A numeric keypad is not going to work with the DS. A numeric keypad will appear like a keyboard to the DS, not a joystick. Those who have suggested that an HID-compliant device will work are only half correct. It needs to be an HID-compliant game controller device.

The strange characters you are seeing on the DS are likely because you are typing on the keyboard and sending those keystrokes to the Linux terminal in which the DS program is running.
Reply With Quote
  #9   Spotlight this post!  
Unread 15-01-2009, 20:32
keen101's Avatar
keen101 keen101 is offline
Ubuntu Linux User
no team
Team Role: College Student
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Loveland, CO
Posts: 228
keen101 is a jewel in the roughkeen101 is a jewel in the roughkeen101 is a jewel in the roughkeen101 is a jewel in the rough
Re: USB input controller how to.

Quote:
Originally Posted by EricVanWyk View Post
Very cool!

Sounds like the perfect topic for a white paper. I inherited some code to turn a PIC18 (or was it 16?) into an HID joystick. I just don't have the time right now to polish it for release.
Thanks. Nah, no need for a white paper. I just copied this project:

http://hobbyelektronik.org/wiki/inde...le=SNES-Joypad

Just use google translate to read it (unless you know German). It was a fun 1 day project. I already had the AVR programmer, and the chip because i had already made the USB Capslocker . It was basically the same parts list and practically the same code too.


Also, for anyone interested here are some other USB AVR projects.

http://www.obdev.at/products/avrusb/projects.html

here is the AVR programmer i used:

http://www.ladyada.net/make/usbtinyisp/


also, I've been trying to complete the PPM RC to USB joystick, however i haven't had any luck in figuring out the fuses need for the chip. I wanted to use the VEX (PPM RC) controller and hook the radio and crystal to the chip. I thought it be pretty cool to use on an Open Source flight simulator with a VEX controller.

edit: I might try to whitepaper it after I've verified it will work with the DS. I'm about 98% sure it will work though.

Last edited by keen101 : 16-01-2009 at 00:45.
Reply With Quote
  #10   Spotlight this post!  
Unread 15-01-2009, 22:51
rogerlsmith's Avatar
rogerlsmith rogerlsmith is offline
Software Engineer
AKA: Roger Smith
FRC #3357 (COMETS)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2007
Location: Grand Rapids, MI
Posts: 214
rogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to beholdrogerlsmith is a splendid one to behold
Re: USB input controller how to.

Quote:
Originally Posted by Dave Flowerday View Post
A numeric keypad is not going to work with the DS. A numeric keypad will appear like a keyboard to the DS, not a joystick. Those who have suggested that an HID-compliant device will work are only half correct. It needs to be an HID-compliant game controller device.

The strange characters you are seeing on the DS are likely because you are typing on the keyboard and sending those keystrokes to the Linux terminal in which the DS program is running.
Thanks Dave, what you've described is kinda what I thought. I hoped it might be a quick way to add lots of inputs and thought it was worth a try. Anyhow, thanks again.
__________________
Roger Smith
Mentor - FRC Team 3357
COMETS - Creating Outstanding Minds, Embracing Technology & Science
---------------------------------------------------------------------------------------

Share FIRST videos, photos and experiences at FIRSTObjective.org
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB to controller board chicklet ExarKun666 Control System 3 03-04-2008 06:17
chicklet USB/xbox 360 controller spsteam1512 Control System 1 10-01-2007 23:14
Important note about USB-6009 input voltage limitations jerry w National Instruments LabVIEW and Data Acquisition 7 11-01-2006 13:09
Connect Playstation Controller to PC USB. kirov Control System 1 28-02-2005 08:24
Robot Controller Digital Input crazycliffy Electrical 11 16-02-2003 04:28


All times are GMT -5. The time now is 03:47.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi