I think if you add 'Serial.print("joy_x = "); Serial.println(joy_x);' to the start of your loop function, you'll see that joy_x is not 504. If you're using an Uno R3, it's going to be 14, which is the value of A0 that you assigned to it.
I'm going to assume that you've got some sort of joystick hooked up to analog inputs A0 and A1? If that's the case, you're going to need to read the values of the inputs in your loop function. Something along the lines of:
I am using an R3. When I change my code like you said i am not only getting 'Joy Center'
The value shows 504 when im not touching it (0-1023 far right) 1024/2=512 mind you. I don't know.
For you A0 (or any A input) noise and imprecise position will make it unlikely to be exactly 504. You should make a test program that prints out the A0 input every second or so. Then try to get the value equal to 504. If I'm right simple noise will make the input "wander" around some value near 504.
Adding a 0.1µF capacitor right at A0 to ground will help but still not going to be able to settle at a single value.
I've removed the debate about the F macro, it has no place here.
I have closed the topic as it was answered in reply #5. I have left in the following replies that seem, to me anyway, to add more useful information for the OP.
@joetech89,
Welcome to the forum
Sometimes people here get a bit over enthusiastic with the help, they mean well but it can get out of hand. I've closed the topic as I think you have your answer, however, if you would prefer to let the discussion continue, or need to ask supplementary questions, then please ask me or one of the other mods to open the topic for you.