what i need to do is write in the screen:
Value 1 = (the reading from sensor)
my code is:
sensorValue = analogRead(sensorOne); // read sensorOne value.
lcd.setCursor(0, 1)
Serial.print("Sensor One = "sensorValue, DEC);
does this look right!?!
what i need to do is write in the screen:
Value 1 = (the reading from sensor)
my code is:
sensorValue = analogRead(sensorOne); // read sensorOne value.
lcd.setCursor(0, 1)
Serial.print("Sensor One = "sensorValue, DEC);
does this look right!?!
Nope.
More like:
sensorValue = analogRead(sensorOne); // read sensorOne value.
lcd.setCursor(0, 1)
lcd.print("Sensor One = ");
lcd.print(sensorOne);
latif:
what i need to do is write in the screen:
Value 1 = (the reading from sensor)my code is:
sensorValue = analogRead(sensorOne); // read sensorOne value.
lcd.setCursor(0, 1)
Serial.print("Sensor One = "sensorValue, DEC);does this look right!?!
The above won't work. You should use the code posted by mowcius.
If you want this to work, you could look into the sprintf on cplusplus.com. The sprintf gives you more handle on how many digits you print before and after the decimal point and what not. I do this:
char msg[20];
sprintf(msg,"value=%04d", sensorValue);
Serial.print(msg);
This way also saves you program size if you will need to use the sprinft for other outputs in your program anyway. You save from not having to compile the overloaded Serial.print(int,int)
BTW, didn't you mean lcd.print instead of Serial.print? 8)