Go Down

Topic: [SOLVED]5V -> analog input gives weird symbols (Read 470 times) previous topic - next topic

retundo

Aug 12, 2010, 09:40 pm Last Edit: Aug 12, 2010, 09:50 pm by retundo Reason: 1
Hi there!

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

Code: [Select]
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 ::)

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy