Pages: [1]   Go Down
Author Topic: [SOLVED]5V -> analog input gives weird symbols  (Read 403 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there!

I connected 5V to analog pin 0 and run this code:

Code:
int sensorPin = 0;    // select the input pin for the potentiometer// select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

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

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

All i got is ÿ as output to serial monitor, what's up with that? Shouldn't it give 1023 as output?

Have to use serial.print instead of serial.write :smiley
« Last Edit: August 12, 2010, 02:50:48 pm by retundo » Logged

Pages: [1]   Go Up
Jump to: