My hcS04 ultrasonic sensor wont work.

It was previously working but then suddenly stopped. I have it in conjunction with a LCD display which is working fine. I have looked up many tutorials and none of them make a difference.

My code:

#include <LiquidCrystal.h>
#define trigPin 8
#define echoPin 9

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT); 
  lcd.begin(16, 2);

void loop() {
  lcd.setCursor(0, 1);
  int duration, distance;
 digitalWrite(trigPin, HIGH);
 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 distance = (duration/2) / 29.1;

I have the serial.print so I could see if it was the LCD, nothing displays their either.

Any suggestions. Thank you.

Have you tried just using the NewPing library? At least to test with and narrow down where the problem might be?