Nokia 5110 keypad stepper motor

Hey guys! new to the forum and new to arduino! I’ve searched here and on Google to try to figure out what I’m doing wrong or not doing right! and I’m just turning circles.

The code below works, the stepper moves to where I want it to go, the current position prints to lower right of the screen the only thing that doesn’t work is when entering the desired location which should print to the left middle of the screen.

Any help would be great!

#include <AccelStepper.h> // AccelStepper Library
#include <Keypad.h>  // Keypad Library
#include "U8glib.h"  // U8glib for Nokia LCD


// Global variables
byte index = 0;
char numbers[20]; // Plenty to store a representation of a float
// Variable to hold CurrentPosition

String currentposition = "";  // Used for display on Nokia LCD

float len = 000.0000;

// Keypad Setup
const byte ROWS = 4; // Four Rows
const byte COLS = 4; // Four Columns
char keys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', '#'},
  {'*', '0', '#', '.'}
};
byte rowPins[ROWS] = {22, 24, 26, 28}; // Arduino pins connected to the row pins of the keypad
byte colPins[COLS] = {31, 33, 35, 37}; // Arduino pins connected to the column pins of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );  // Keypad Library definition


// U8glib Setup for Nokia LCD
#define backlight_pin 11
U8GLIB_PCD8544 u8g(3, 4, 6, 5, 7);  // Arduino pins connected to Nokia pins:
// CLK=3, DIN=4, CE=6, DC=5, RST=7


// AccelStepper Setup
AccelStepper stepper(1, A0, A1);  // 1 = Easy Driver interface
// Arduino A2 connected to STEP pin of Easy Driver
// Arduino A3 connected to DIR pin of Easy Driver

static char outstr[15];

void setup(void) {





  //  Light up the LCD backlight LEDS
  analogWrite(backlight_pin, 0);  // Set the Backlight intensity (0=Bright, 255=Dim)

  //  AccelStepper speed and acceleration setup
  stepper.setMaxSpeed(1500);  // Not to fast or you will have missed steps
  stepper.setAcceleration(400);  //  Same here

  // Draw starting screen on Nokia LCD
  u8g.firstPage();
  do {

    u8g.drawHLine(0, 15, 84);
    u8g.drawVLine(50, 16, 20);
    u8g.drawHLine(0, 35, 84);
    u8g.setFont(u8g_font_profont11);
    u8g.drawStr(0, 10, "ENTER DISTANCE");
    u8g.drawStr(62, 29, "in");
    u8g.drawStr(4, 46, "Cur Pos");
  }
  while ( u8g.nextPage() );

}


void loop()
{
  char key = keypad.getKey();
  if (key != NO_KEY)
  {
    if (key == 'C')
    {
      index = 0;
      numbers[index] = '\0';
    }
    else if (key == '.')
    {
      numbers[index++] = '.';
      numbers[index] = '\0';
    }
    else if (key >= '0' && key <= '9')
    {
      numbers[index++] = key;
      numbers[index] = '\0';
    }
    else if (key == '#')
    {
      float len = atof(numbers);            // Do whatever you need to with len

      dtostrf(len, 12, 3, outstr);
      drawnokiascreen(outstr);


      stepper.runToNewPosition(len * 680); //  steps for 1 inch


      index = 0;
      numbers[index] = '\0';

    }
  }
}






void drawnokiascreen(String outstr) {

  u8g.firstPage();
  do {
    u8g.drawHLine(0, 15, 84);
    u8g.drawVLine(50, 16, 20);
    u8g.drawHLine(0, 35, 84);
    u8g.setFont(u8g_font_profont11);
    u8g.drawStr(0, 10, "ENTER DISTANCE");
    u8g.drawStr(62, 29, "in");
    u8g.setPrintPos(4, 46);
    u8g.print(outstr);  //  Display current position of stepper
  }
  while ( u8g.nextPage() );

}

Bump.

the only thing that doesn't work is when entering the desired location which should print to the left middle of the screen.

Instead it scribbles on the back side of the moon? You need to describe what the code actually does, and then how that differs from what you want

Such a great forum! post for the first time, wait two days to get a reply, get sarcasm to start!

Found help elsewhere within a couple hours.

Thanks anyways, don't bother to reply because I won't be back.