void setup() {
char outStr[10];
byte rxVal = 0;
Serial.begin(115200);
do {
float voltage = (300.0 + rxVal) / 100.0;
dtostrf(voltage, 6, 2, outStr); // as the volatage is x.dd and we want 6 positions, we will have 2 spaces in front of the value
Serial.print("rxVal = "); Serial.print(rxVal);
Serial.print("\tvoltage = "); Serial.print(voltage, 2); // printing the float with 2 decimal
Serial.print("\t\tvoltage string = \""); Serial.print(outStr); // printing the string
Serial.println("\"");
} while (++rxVal != 0);
}
void loop() {}