ey!
I am trying to use Serial Monitor to see the values that a photoresistor delivers to arduino, and I really dont understand why, I cannot handle it.
int sensorValue;
void setup() {
sensorValue = analogRead(A0);
}
void loop() {
sensorValue = analogRead(A0);
Serial.begin(9600);
Serial.println(sensorValue);
}
Attached as well. what am I doing wrong?
simple.ino (174 Bytes)
system
March 3, 2014, 7:11pm
2
What do you mean "cannot handle it"?
void setup() {
Serial.begin(115200);
sensorValue = analogRead(A0);
}
thanks but still...
this is what serial monitor shows me now
?Â$?Ê?þ
system
March 3, 2014, 7:18pm
5
Even with the Serial.begin in setup()?
Robin2
March 3, 2014, 7:20pm
6
You should have Serial.begin(9600);
in setup(), not in loop().
You also need to have the same baud rate selected in the serial monitor as in the Arduino sketch - for example both at 9600 baud or both at 115200 baud.
...R
ok
this is my code now, and it is working
int sensorValue;
void setup() {
Serial.begin(9600);
sensorValue = analogRead(A0);
}
void loop() {
Serial.println(sensorValue);
}
but I receive the same value (1008)
something else is also wrong... have to check
system
March 3, 2014, 7:27pm
8
You're only reading the input once - it isn't surprising the value doesn't change
well, can you provide me with the way to monitor this value continuosly?
LarryD
March 3, 2014, 7:31pm
10
If loop runs forever, what do you think will happen?
LarryD
March 3, 2014, 7:32pm
11
Move something out of setup and put it into loop.