If it shows up as a joystick on the Pi, you'll find it in /dev/input as js# (usually js0). You can use various libraries to help you get the input from it (SDL, for example), or you can read the raw data from the device (as seen below).
If it's not listed as a joystick, you can run lsusb (L, not i), to list the usb devices, at which point you can find the device number. From there, you'll usually find it in /dev/bus/usb/001/ as the number from lsusb. You should be able to open this device and read the raw data from it. Here's some simple C code to get you started (in case you're not sure):
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
int main(){
const int BUFFER_SIZE = 1024;
char buffer[BUFFER_SIZE];
int bytesRead,joystick;
joystick = open("/dev/bus/usb/001/012",O_RDONLY);
if (joystick == -1){
printf("ERROR: Couldn't Open Joystick!\n");
return 0;
}
bytesRead = read(joystick,buffer,BUFFER_SIZE);///returns -1 on error
printf("Read %d Bytes!\n",bytesRead);
close(joystick);
return 0;
}