;Create a joystick that moves
;JX=JoyX()
;JY=JoyX()
;JX=JX*20
;JY=JY*20
JX=JoyXDir()*20
JY=JoyYDir()*20
RotateEntity Camera,JY,-JX,0
;TranslateEntity Camera,0,0,0
Um.... the first four lines of your code are completely redundant, as commented out above. I can't even tell what the rest of your code is trying to do, so I'll leave it alone.
Make it so that your joystick does not directly control the camera. Introduce a 'turnSpeed#' variable. Limit it to +/- 20. If you push the joystick left, do turnSpeed# = turnSpeed - 0.1. Push it right, add on 0.1.
Then check if the joystick is 'dead'. To do this do NOT use "If Joyx() = 0". Use "If Abs(Joyx()) < 0.05" etc - reason being that even a correctly calibrated joystick is never ever going to show exactly 0 when its centered.
If the stick is not being pushed either direction, then you need to gradually return the turnspeed variable to 0. If its less than 0, add on 0.1. If its more than 0, subtract 0.1.
Then use TurnEntity Entity,0,turnspeed,0.
Why didn't I just write the code for you? Two reasons. First, I can't be bothered. Second, you'll learn more by being guided in the right direction then doing the job yourself.
[edit]
Quick example because I'm bored today:
Graphics3D 800,600
sphere = CreateSphere()
ScaleEntity sphere,2,1,1
camera = CreateCamera()
light = CreateLight()
RotateEntity light,0,90,0
TranslateEntity camera,0,5,-20
Global turnSpeed# = 0
Global maxTurnSpeed = 20
Global port% = 0
While Not KeyDown(1)
Cls
UpdateStick()
TurnEntity sphere,0,turnSpeed,0
RenderWorld
Flip
Wend
Function UpdateStick()
Local xs# = JoyX(port)
turnSpeed = turnSpeed + (1 * xs)
If turnSpeed < 0-maxTurnSpeed Then turnSpeed = 0-MaxTurnSpeed
If turnSpeed > MaxTurnSpeed Then turnSpeed = MaxTurnSpeed
If Abs(turnSpeed) < 0.1 Then turnspeed = 0
If Abs(xs) < 0.1;joystick is dead
If turnSpeed < 0 Then turnSpeed = turnSpeed + 1
If turnSpeed > 0 Then turnSpeed = turnSpeed - 1
If Abs(turnSpeed) < 1 Then turnSpeed = 0
EndIf
End Function