output potentiometer values from arduino

Hi,

I'm currently trying to get my arduino to output the value of a potentiometer. Is there a command for this? I know very little about arduino.
I'm trying to drive 2 wheelchair motors. I have the the invacare motor controller as well as MKIVA control module. What I'm trying to do is
drive the motors by using the arduino to output potentiometer values as if were coming from the actual joystick.

r. Is there a command for this? I

Serial.println (analogRead (potPin));

To "output" potentiometer values directly is not possible.

The closest an Arduino can do is output a PWM signal which, if passed through a low-pass filter, is an analog voltage output between 0 and 5V. You might be able to use this to control the motor controller, but I don't know.

If you require real potentiometer-like control then you will need to investigate "Digital Potentiometers". These are chips which act like a potentiometer, but unlike a real pot you control them using a digital signal (usually either SPI or I²C).

Most will only tolerate up to 5V though, so if the system you are controlling puts more than that across the pot then you may see Magic Smoke™.

Another solution might be to use a MOSFET as a voltage-controlled resistor. Vary the gate voltage within the triode region and the resistance between drain and source varies.