johnwasser:
A simpler way to display a floating point value with three decimal places is to specify the number of decimal places in .print().void setup() {
Serial.begin(9600);
}
void loop() {
int rawcurr = analogRead(A0);
float current = (516 - rawcurr) * 45 / 1023.0;
Serial.print(current, 3);
Serial.print(" , ");
Serial.println(rawcurr);
delay(500);
}
For some strange reason
Serial.println(current, 3);
returns all 0.000 (I use linebreak here, it is the last to be printed on the line). No float number. What did I do wrong?