Pseudo code only, but maybe something like:
inches = steps / 16000;
thousteps = steps % 16000;
thou = thousteps / 16;
print (inches);
print (".");
if (!thou)print ("000");
else if(thou < 10) print ("00")
else if (thou < 100) print ("0");
if(thou)print (thou);
Here am just printing to LCD what the stepX variable is
what I got going is
loat stepsX = 16; // Used for Jog -
float stepsY = 16;
String printjogX;
String printjogY;
In void setup // print initial screen
lcd.setCursor(0, 1);
lcd.print("Jog =");
lcd.setCursor(6, 1);
printjogX = String((stepsX / 16) * .001, 3);
lcd.print(printjogX);
In void loop
case btn_stepXPlus1: // Select + Up Button - 231 from Nes
stepXPlus1();
break;
// Increment Up
void stepXPlus1() // Select + Up Button
{
stepsX = (stepsX + 16); // 16 = 0.001
if (stepsX <= 16)stepsX = 16; // Default
displayXOn();
delay(250);
}
void displayXOn()
{
lcd.setCursor(6, 1);
printjogX = String((stepsX / 16) * .001, 3);
lcd.print(printjogX);
}
If I gather you correctly - leave variable stepsX as an int and on the fly change it to a float so with
int stepsX = 16;
String printjogX;
e.g. printjogX = String(((float)stepsX / 16) * .001, 3);
works - - prints out correctly
e.g. printjogX = String((stepsX / 16) * .001, 3);
also works
Oh Boy - - Float and String each something I need to delve into farther - Coffee Assistant!!
So, at least the plan was, as I found out, LCD's are not the quickest responding things on the block, was to change on the screen only that portion that needed changing.
Gonna putt with the car today and let your advise rattle around, found that when doing something that I do know, the things I don't know much about get clearer . .