yes, kind of. You need to be careful about when you memorise the previous values and handle CTS
may be something like this would be "cleaner":
#include <LiquidCrystal.h>
LiquidCrystal lcd(10, 9, 8, 7, 6, 5); // put your pin numbers here
const byte lcdContrastPin = 11; // LCD CONTRAST PIN
const byte CTSPin = 2; // Clear To Send PIN
const byte RSPin = 3; // Request Sample PIN
byte DMM_ARRAY[6]; // Where to store the Bytes read
bool Get_data() {
bool success = (Serial.available() >= 6);
if (success) Serial.readBytes(DMM_ARRAY, 6);
return success;
}
void setup() {
pinMode(CTSPin, OUTPUT);
pinMode(RSPin, OUTPUT);
pinMode(lcdContrastPin, OUTPUT);
analogWrite(lcdContrastPin, 50); //LCD CONTRAST AMOUNT
Serial.begin(1000000);
lcd.begin(16, 2);
lcd.print(F("GG1320AN21 TEST"));
}
void loop() {
static float previousValue = 0;
unsigned long previousMicros = 0;
float deltaTheta;
unsigned long currentMicros = micros(); // you could do this with millis() too, depends on the precision you want
if (currentMicros - previousMicros >= 1000000ul) { // 1s in µs
unsigned long deltaT = currentMicros - previousMicros; // that will be give or take 1s
digitalWrite(CTSPin, HIGH); // CTS Open
digitalWrite(RSPin, HIGH); // RS
delayMicroseconds(50);
digitalWrite(RSPin, LOW); //RS
if (Get_data()) { //Read the Serial bytes coming in
float currentValue = DMM_ARRAY[2];
delayMicroseconds( 200 );
digitalWrite(CTSPin, LOW); // CTS Close
deltaTheta = ((previousValue - currentValue) * 1.113065); // count * 1.113065 ARC SEC / SEC
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(deltaTheta / (deltaT / 1000000.0)); //3 decimal place values
lcd.setCursor(0, 1);
lcd.print(DMM_ARRAY[2]);// Print btye 3 (LSB)
previousValue = currentValue;
previousMicros = currentMicros;
} else digitalWrite(CTSPin, LOW); // CTS Close
}
}
(typed here from your code, fully untested)