#include <LiquidCrystal_I2C.h>;
#define UltrasonicDistance;
int analogPin= A3;
int val = 0;
#define encdir
#define inputCLK 0
#define inputDT 1
int counter = 0;
int currentStateCLK;
int previousStateCLK;
float distance = 0;
String encdir ="";
long readUltrasonicDistance(int triggerPin, int echoPin);
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
pinMode (inputCLK, INPUT);
pinMode (inputDT, INPUT);
Serial.begin (9600);
previousStateCLK = digitalRead(inputCLK);
lcd.init();
lcd.setBacklight(1);
//lcd.display(1);
lcd.print("Initializing");
delay(2000);
lcd.clear();
delay(1000);
lcd.print("Standby...");
delay(1000);
lcd.clear();
delay(500);
}
void loop() {
val = analogRead(analogPin);
distance = (.0104 * val) + 1.18;
lcd.print(distance);
delay(1000);
if ((distance >= 2) && (distance < 7)){
lcd.clear();
lcd.print("Material Present");
delay(2500);
}
else {
lcd.clear();
lcd.print("Material Absent");
}
delay(2500);
lcd.clear();
delay(1000);
currentStateCLK = digitalRead(inputCLK);
if(currentStateCLK != previousStateCLK){
counter--;
encdir = "CCW";
}
}
Error Message as make of Follow:
C:\Users\alecg\OneDrive\Documents\Arduino\sketch_aug13a\sketch_aug13a.ino:13:16: error: expected unqualified-id before '=' token
String (encdir ="");
^
C:\Users\alecg\OneDrive\Documents\Arduino\sketch_aug13a\sketch_aug13a.ino:13:16: error: expected ')' before '=' token
C:\Users\alecg\OneDrive\Documents\Arduino\sketch_aug13a\sketch_aug13a.ino: In function 'void loop()':
C:\Users\alecg\OneDrive\Documents\Arduino\sketch_aug13a\sketch_aug13a.ino:57:12: error: expected primary-expression before '=' token
encdir = "CCW";
^
exit status 1
Compilation error: expected unqualified-id before '=' token
Why my programming no make of work? Please help of do make work?