I just get a compile error during compiling code ,please support me to resolve this problem.
i am also attach my code file
#include<Wire.h>
#include<LiquidCrystal_I2C.h>
//Set the LCD address to 027 for a chars and 2 line dispaly
LiquidCrystal_I2C lcd(027, 16, 2) ;
const int stepPin=3;
const int dirPin=4;
int buttonPin;
int r;
int buzzer=10;
int m=8;
void setup()
{
buttonPin=11; //whatever pin your buton is plugged into)
r=12;
pinMode(buttonPin,INPUT_PULLUP);
pinMode(r,INPUT);
// Initiliaze the LCD
lcd.begin();
//Turn on the blacklight and print a message.
lcd.backlight();
lcd.clear();
lcd.setCursor(2,0); //column ,row
lcd.print(Press Start);
//sets the two pin as outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
pinMode(m,OUTPUT);
while(digitalRead(r)== LOW)
{
digitalWrite(dirPin,LOW);//enable the motor to move in particular direction
//make 200 pulses for making one full cycle roataion
for(int x=0; x<400;x++)
digitalWrite(stepPin, HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
if(digitalRead(r)==HIGH)
break;
}
}
void loop()
{
//check button pressed ,if so enter program condition(inside if statement)
if(digitalRead)(buttonPin==HIGH)//functions based off of button pulling input pin LOW
{
tone(buzzer ,800);
delay(1000);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0); //Column,row
lcd.print(Start filling);
{
delay(500);
lcd.setCursor(2,1);//column,row
lcd.print(Bottle 1/6);
digitalWrite(m,HIGH);
delay(1650);
digitalWrite(m,LOW );
delay(1000);//one second delay;
tone(buzzer, 1000);
delay(200);
noTone(buzzer);
}
{
digitalWrite(dirPin,HIGH);// Enabaling the motor to move in a particular direction
//Makes 00 pulses for making one full cycle rotation
for(int x=0;x<100; x++){
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
}
delay(500);
lcd.setCursor(2,1); //column ,row
lcd.print(Bottle 2/6);
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
delay(1000);//one second delay
tone(buzzer,1000);
delay(200);
noTone(buzzer);
}
{
digitalWrite(dirPin,HIGH);// Enabaling the motor to move in a particular direction
//Makes 00 pulses for making one full cycle rotation
for(int x=0;x<100; x++){
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
}
delay(500);
lcd.setCursor(2,1); //column ,row
lcd.print(Bottle 3/6);
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
delay(1000);//one second delay
tone(buzzer,1000);
delay(200);
noTone(buzzer);
}
{
digitalWrite(dirPin,HIGH);// Enabaling the motor to move in a particular direction
//Makes 00 pulses for making one full cycle rotation
for(int x=0;x<100; x++){
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
}
delay(500);
lcd.setCursor(2,1); //column ,row
lcd.print(Bottle 4/6);
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
delay(1000);//one second delay
tone(buzzer,1000);
delay(200);
noTone(buzzer);
}
{
digitalWrite(dirPin,HIGH);// Enabaling the motor to move in a particular direction
//Makes 00 pulses for making one full cycle rotation
for(int x=0;x<100; x++){
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
}
delay(500);
lcd.setCursor(2,1); //column ,row
lcd.print(Bottle 5/6);
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
delay(1000);//one second delay
tone(buzzer,1000);
delay(200);
noTone(buzzer);
}
{
digitalWrite(dirPin,HIGH);// Enabaling the motor to move in a particular direction
//Makes 00 pulses for making one full cycle rotation
for(int x=0;x<100; x++){
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin, LOW);
delayMicroseconds(2000);
}
delay(500);
lcd.setCursor(2,1); //column ,row
lcd.print(Bottle 6/6);
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
delay(1000);//one second delay
tone(buzzer,1000);
delay(200);
noTone(buzzer);
}
{
tone(buzzer,800);
delay(1000);
noTone(buzzer);
lcd.clear();
lcd.setCursor(0,0);//column,row
lcd.print(*Job Done!Place New Bottles);
}
}
automatic_bottle_filing.ino (4.35 KB)