reading encoder values

Hi
I write the code for reading the values of the encoder but it just shows two values 0 and -1
my code is:

#include <Encoder.h>
Encoder myEncoder(2,3);
double Position;

void setup () {
Serial.begin(250000);
Serila.println('Encoder Test");
}
long oldPosition = -999;

void loop() {
long newPosition = myEncoder.read();
if (newPosition != oldPosition){
oldPosition = newPosition;
Serial.print('Encoder Position = ");
Serial.println(newPosition);
}
}

Serila.println('Encoder Test");
Serial.print('Encoder Position = ");

Something tells me that the code you posted is not the code that does what you say it does

what do you mean?

Help please

It contains Typo's ! like this it will not compile therefore i could not have done anything.
if (HeliBob.says("something tells me")) checkLines(code);

sorry it was writing mistake
the correct code is :

#include <Encoder.h>
Encoder myEncoder(2,3);
double Position;

void setup () {
Serial.begin(250000);
Serial.println(“Encoder Test”);
}
long oldPosition = -999;

void loop() {
long newPosition = myEncoder.read();
if (newPosition != oldPosition){
oldPosition = newPosition;
Serial.print("Encoder Position = ");
Serial.println(newPosition);
}
}

but it shows 0 and when I rotate the shaft of the motor the value would be -1 and the encoder value changes to 0 and -1

I change the pins of the encoder in code and in wiring from 2, 3 to A0, A1
and it works! but why it didn’t work with pins2 and 3?

don't know, does the encoder require analog inputs ? also cold you please use code tags and indent properly.

ok thank you and sorry about code, I will use the code tag