16 x 2 LCD No Scroll Stationary Text

How do i get the text on the 16 x 2 LCD screen to not scroll.
The display text is less than 16 characters so there is no need for the scroll to happen i just want text to display followed by a variable value and stay in a fixed position.

Iv tried Google but all the questions are asking how to make text scroll which is what im trying to avoid

  LCD.setCursor(0,0);             // Set Text Location Row 1
  LCD.clear();
  LCD.print ("DIST : ");          // Print String
  LCD.print (DISTANCE);           // Print Variable 
  LCD.print (" cm");              // Print Unit
  delay(200);

You have not described enough for us to be able to answer your questions.
We need details like what specific lcd you are using and the full code you are using so we can see what library you are using to control it and how you are initializing the library and the lcd.

--- bill

LCD - QAPASS 1602A

// Include LCD Libary
#include <LiquidCrystal.h>

// Create LCD Object
LiquidCrystal LCD(1, 2, 4, 5, 6, 7); // Parameters

// Variables

// Velocity Variable For Ultrasonic Sensor Calculation
float V = 0.034; // Speed of Sound 340 m/s in cm/us
long DURATION;   // Time
int DISTANCE;    // Distance
int PERCENT;     // Capacity Percentage

// Define Pin Numbers Ultrasonic Sensor
const int US_TRIG_PIN = 9;  // Ultrasonic Sensor Trigger TX
const int US_ECHO_PIN = 10; // Ultrasonic Sensor Echo RX

void setup() 
{
  // put your setup code here, to run once:

  // Initalise LCD (16 x 2)
  LCD.begin(16,1);
  
  // Initalise Pins I/O
  pinMode (US_TRIG_PIN, OUTPUT);
  pinMode (US_ECHO_PIN, INPUT);

  // Initalise Serial 
  Serial.begin(9600);

}

void loop() 
{
  // put your main code here, to run repeatedly:
  
  // Trig Output Clear
  digitalWrite(US_TRIG_PIN, LOW);
  delayMicroseconds(2);

  // Set Trig 10 u/s Transmit Pulse
  digitalWrite(US_TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(US_TRIG_PIN, LOW);

  // Read Echo Pulse Travel Time
  DURATION = pulseIn(US_ECHO_PIN, HIGH);

  // Calculate Distance Measurement
  DISTANCE = DURATION*V/2;

  // Calculate Capacity Percent Full 
  PERCENT = 3.333*DISTANCE;
  
  //Return Value LCD
  LCD.setCursor(0,0);             // Set Text Location Row 0
  LCD.clear();
  LCD.print ("CAPACITY: ");       // Print String
  LCD.print (PERCENT);            // Print Variable 
  LCD.print (" %");               // Print Sign
  
  LCD.setCursor(0,1);             // Set Text Location Row 1
  LCD.clear();
  LCD.print ("DIST: ");          // Print String
  LCD.print (DISTANCE);           // Print Variable 
  LCD.print (" cm");              // Print Unit
  delay(200);
  
  // Return Value Serial Monitor
//  Serial.print("Distance: ");
//  Serial.println(DISTANCE);
//    delay(200); // 0.2s Update Cycle
//  Serial.print("Percent Full: ");
//  Serial.println(PERCENT);
//    delay(200); // 0.2s Update Cycle
  
}

I don't see anything in your setup() and loop() code that would cause a scrolling issue.
However, you are using pin 1 to control the LCD.
Arduino pins 0 & 1 are used by the serial port on many Arduino boards so it is best to avoid using those pins.
Here is a link that shows the pin uses on some of the Arduino boards.

Oh, and you said it was 16x2 but you initialized it as 16x1.

  // Initalise LCD (16 x 2)
  LCD.begin(16,1);

--- bill

Could using Pin1 possibly be causing the scrolling ? I do not have any other Pins available they are being used for IO.

I forgot to swap the (16,1) back i was experimenting with changing this as i had the text scrolling across both rows and this was the only way i could prevent it and keep it solely on the first row.

Don't use pins 0 or 1.

mtom1991:
I do not have any other Pins available they are being used for IO.

I'm not sure I believe you. For what are you using digital pins 14 to 19, otherwise known as A0 to A5?

What you really should be doing is to use an I2C "backpack" which uses A4 and A5 to access it as well as any other I2C devices.

Paul__B:
Don't use pins 0 or 1.
I'm not sure I believe you. For what are you using digital pins 14 to 19, otherwise known as A0 to A5?

What you really should be doing is to use an I2C "backpack" which uses A4 and A5 to access it as well as any other I2C devices.

i wasnt aware i could use the analog pins as digital pins ??

mtom1991:
I wasn't aware I could use the analog pins as digital pins ??

I thought as much. :grinning:

Common misunderstanding. A0 to A5 (On the ATmegaxx8) are simply digital pins with added analog functionality. A6 and A7 on a Nano (which is what you should be using for any serious project, not a UNO) or Pro Mini are however analog inputs only.

You will often want to use I2C to work with "port expander" and sensor modules - such as the LCD backpack mentioned, they form a common bus to which many devices can be connected together, so it is a good idea to reserve them for that purpose.

Pins 0 and 1 are the serial interface for downloading code and communication with the serial monitor or other communications arrangements, so you really do not want to try and use them for other I/O.

Paul__B:
Common misunderstanding. A0 to A5 (On the ATmegaxx8) are simply digital pins with added analog functionality. A6 and A7 on a Nano (which is what you should be using for any serious project, not a UNO) or Pro Mini are however analog inputs only.

A common misunderstanding brought about by way Arduino describes pins as "analog pins" and "digital pins" - I have never understood what the hell they were thinking, as it confuses a large portion of new arduino users.

I think A6 and A7 on the SMD version of the atmega x8 series are the only analog-only pins in the entire AVR product line...

DrAzzy:
I think A6 and A7 on the SMD version of the atmega x8 series are the only analog-only pins in the entire AVR product line...

"What could we do with these left-over cells in the layout?"