Arduino as a PC joystick

I want to use a potentiometer as a additional controller for gaming e.g. throttle.I have built it and have the code to read the values:

int sensorPin = A0;
int sensorValue =0;

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.println(analogRead(sensorPin));
delay(100);
}

but I dont know how to input the values in windows and the game to recognize them

You are writing to a serial port. You need some app on the PC that is reading the serial port, and doing something with the data.

I know that but are there any programs that do that

Or you buy a Leonardo or Micro (or some others that can act like a HID).

Try vJoy and UJR

http://vjoystick.sourceforge.net/site/

http://evilc.com/category/proj/

Thanks, but I already did it with UnoJoy