Text repeaing

I am trying to print "ARMED" and "NOT ARMED" on my LCD. "ARMED" appears first. When I make "NOT ARMED" appear "NOT ARMED" appears. Then I make "ARMED" appear, and "ARMEDRMED" appears. How do I make "ARMED" appear instead of "ARMEDRMED"? I did try lcd.setCursor(0,0);.

You need to clear the screen with lcd.clear().

that dosent work. i tried that

Can I see your code?

This is the code:

#include <LiquidCrystal.h>

int buttonState = 0;
int doorState = 0;
int activated = 0;

int timeZone = 5; // time zone in seconds

int button = 2;
int door = 3;
int activate = 4;
int alarm = 13;

LiquidCrystal lcd(10, 9, 8, 7, 6, 5);

void setup()
{
  pinMode(button, INPUT);
  pinMode(door, INPUT);
  pinMode(activate, INPUT);
  pinMode(alarm, OUTPUT);
  lcd.begin(16,2);
  
  digitalWrite(alarm, LOW);
  lcd.setCursor(0, 1);
  lcd.print("ON");
}

void loop()
{
  activated = digitalRead(activate);
  if(activated == HIGH){
  if(digitalRead(button) == HIGH){
    buttonState = HIGH;
    lcd.setCursor(0,0);
    lcd.print("NOT ARMED");
    delay(1000 * timeZone);
  }else{
    buttonState = LOW;
    lcd.setCursor(0,0);
    lcd.print("ARMED");
    }

  doorState = digitalRead(door);
  if(doorState == LOW && buttonState == LOW){
    digitalWrite(alarm, HIGH);
  }
  }else{
    lcd.setCursor(0, 0);
    lcd.print("NOT ARMED");
  }
}

I usually overwrite the line with spaces first.

In this case, I might be inclined to just make my word "ARMED" a bit longer as "ARMED " to make sure it overwrites what's already on the screen.

Good idea.
It works.

As a matter of style, I like things centred on the screen; looks nicer in my eyes. In that case, print 16 characters always, with half the spaces each front and back.

ARMED_

NOT_ARMED_