Hi all,
I'm not sure if you can do this but I want to write a measured analogue value to a single line (see pic) in Arduinos serial monitor.
Apart from printing to a new line (see pic) after every read this is what i want.
The code is here:
I have used Serial.writeln as if not it just writes horizontally. Is this possible because I can't see what can do this in the Serial library.
I'm not sure if you can do this but I want to write a measured analogue value to a single line (see pic) in Arduinos serial monitor.
Apart from printing to a new line (see pic) after every read this is what i want.
The code is here:
Code:
const int analogPin = A0;
float analogValue = 0;
float voltage;
float five = 5.000000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
//analogValue = map(analogValue, 0, 1023, 0, 5);
analogValue = analogRead(analogPin);
voltage = (analogValue/1023)*five;
Serial.print("analog value = " );
Serial.println(voltage, DEC);
delay(125);
}
}
Attachments
-
26.2 KB Views: 16
-
48.6 KB Views: 15