Serial printing letters instead of numbers

When I run the serial monitor it shows letters instead of number, the serial baud is set correctly (9600 baud) on the monitor and in the code. We are using the MKR1000 board.

int sensorPin = A0; 
int sensorValue= 0;

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

}
void loop() {
  sensorValue = analogRead(sensorPin);
  Serial.print(sensorValue);
  Serial.print('\n'); 
  delay(500);
}

Use print instead of write.

CtrlAltElite:
Use print instead of write.

Tried it, didn't work.

It should, try again, you did something wrong :wink: And before you respond, read How to use this forum please!

Can you tell us what "didn't work" means in your universe?

Post your code.
Use code tags.

It may seem obvious, but does the speed set for the serial monitor match the speed set in your sketch?

...and don't edit earlier posts that make the responses to the original code look stupid.

CtrlAltElite:
It may seem obvious, but does the speed set for the serial monitor match the speed set in your sketch?

Yes, It is the same speed in the sketch and in the serial monitor.

Arduino_MKR1000_Problems:
When I run the serial monitor it shows letters instead of number

What do you mean "letters instead of number"? The serial monitor will display numbers as ascii text, and you can change the formatting to binary, octal, decimal, and hexadecimal.

Danois90:
What do you mean "letters instead of number"? The serial monitor will display numbers as ascii text, and you can change the formatting to binary, octal, decimal, and hexadecimal.

How do I do that?

Arduino_MKR1000_Problems:
How do I do that?

You could RTFM