Is the problem in the code or in the OLED screen?

@blh64 Tank you so very much, your suggestion to reduce the size of the arrays was the key, I lowered it to 10 and it finally started working!! Then I worked my way up to realize that 65 is the threshold at which the code stopped working (I will be keeping the size below that value to allow some room for the memory just in case).

I will do one more cleaning of the code tomorrow and share here as an FYI.

You have no idea how much I appreciate your help, I wish there was a way to repay the favor!! :smiley: :smiley: :smiley:

EDIT:
Here's the final code (at least for now) that I will be using for this project:

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128  // OLED display width, in pixels
#define SCREEN_HEIGHT 64  // OLED display height, in pixels

// On an arduino UNO:       A4(SDA), A5(SCL)
#define OLED_RESET 4         // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C  ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

const int maxInput = 65;

char InputArray[maxInput]; // stores the input word for displaying on the screen
char Output[maxInput]; // stores the final result to show on screen
char Input[36] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; // shows value on screen and allows selection to store in char InputArray
char AlphaNumChart[6][6] = { { 'a', 'b', 'c', 'd', 'e', 'f' },
                             { 'g', 'h', 'i', 'j', 'k', 'l' },
                             { 'm', 'n', 'o', 'p', 'q', 'r' },
                             { 's', 't', 'u', 'v', 'w', 'x' },
                             { 'y', 'z', '0', '1', '2', '3' },
                             { '4', '5', '6', '7', '8', '9' } }; // based on coordinates calculated by the formula, will select characters from this matrix to store in char Output

byte num[maxInput];  //stores the input values for computation
int Key=2; // key to allow selection of the value to store in char InputArray
int fadeValue1; // raw potentiometer value
int fadeValue2; // potentiometer value adjusted to select one of the 36 options from char Input
char charselect; // to show and store selected value from char Input
int InputArrayPos = 0; //this is just for word positioning on the display
int cursor; // this is just for word positioning on the display
int CursorStart; // this is just for word positioning on the display
int CursorRef;  // this is just for word positioning on the display
int CursorEnd;  // this is just for word positioning on the display

void setup() {
  pinMode(Key, INPUT);
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.setTextWrap(false);
  display.clearDisplay();
}

void loop() {

  fadeValue1 = analogRead(A0);
  fadeValue2 = map(fadeValue1, 0, 1023, 0, 36);
  if (fadeValue2 != 36) charselect = Input[fadeValue2];

  display.clearDisplay();
  displayPrint(0, 0, WHITE, 1);
  display.println("Your selection:");

  displayPrint(55, 15, WHITE, 4);
  display.println(charselect);

  if (fadeValue2 == 36) {
    display.clearDisplay();
    displayPrint(0, 22, WHITE, 2);
    display.println("SHOW Output");
  }

  if ((digitalRead(Key) == 1) && (fadeValue2 != 36)) {

  addCharInput();

  delay(500);

  }


  while ((digitalRead(Key) == 1) && (fadeValue2 == 36)) {

   calculateOutput(); 
   displayOutput();
  }

displayInput();

}

void calculateOutput() {

  for (int i = 0; i < InputArrayPos; i++) {
    int X = num[i] / 6;
    int Y = num[InputArrayPos - 1 - i] % 6;
   Output[i] = AlphaNumChart[Y][X];
  }
  Output[InputArrayPos] = '\0';
}

void displayOutput() {

  CursorEnd = (-12 * (InputArrayPos)) + display.width();
  CursorStart = 0;

  while (digitalRead(Key) == 1) {

    if (InputArrayPos <= 10) {
      display.clearDisplay();
      displayPrint(0, 0, WHITE, 1);
      display.println("Your Output:");

      displayPrint(0, 27, WHITE, 2);
      display.println(Output);
      display.display();
    }

    if (InputArrayPos > 10) {
      display.clearDisplay();
      displayPrint(0, 0, WHITE, 1);
      display.println("Your Output:");
      displayPrint(CursorStart, 27, WHITE, 2);
      display.println(Output);
      display.display();
      if (CursorStart == 0) {CursorStart = CursorStart - 2; CursorRef = 0; delay(1000);}
      if ((CursorStart < 0) && (CursorRef == 0)) CursorStart = CursorStart - 2;
      if (CursorStart == CursorEnd) {CursorStart = CursorStart + 2; CursorRef = 1; delay(1000);}
      if ((CursorStart < 0) && (CursorRef == 1)) CursorStart = CursorStart + 2;
    }
  }
}


void displayPrint(int x, int y, int color, int size) {
  display.setCursor(x, y);
  display.setTextColor(color);
  display.setTextSize(size);
}


void addCharInput() {

  num[InputArrayPos] = fadeValue2; // store index for later computation
  Serial.print("added to num ");
  Serial.print(num[InputArrayPos]);
  InputArray[InputArrayPos++] = Input[fadeValue2];

  InputArray[InputArrayPos] = '\0';
  if ( InputArrayPos >= maxInput - 1 ) {
    InputArrayPos = maxInput - 2;
  }
  display.clearDisplay();
  displayPrint(0, 0, WHITE, 1);
  display.println("Your selection:");
  displayPrint(50, 22, WHITE, 2);
  display.println("OK!");

  displayInput();
  Serial.println("added ");
  Serial.print(fadeValue2);
}


void displayInput() {
  int cursor = 0;

  if (InputArrayPos > 10) {
    cursor = (10 - InputArrayPos) * 12;
  }
    displayPrint(cursor, 47, WHITE, 2);
    display.println(InputArray);
    display.display();
}