SSD1306 allocation failed

Hi There I am having a problem getting the sketch with a 128 X 64 OLED
I Get the message on the serial Monitor SSD1306 allocation failed I am using the Arduino Nano for the project,
To be added is some switch case coding but for mow I am trying to display distance on the OLED.
Code attached.

Your help would be greatly appreciated

Vl53LOX_SSD1306_Comb.ino (2.9 KB)

A nano has 2 KiB of RAM, you need 1 KiB for the display buffer. There's simply not enough RAM available. Either save some memory in other parts of your sketch, use a display library without or with a partial buffer, or get a board with more RAM.

Pieter