[QUESTION] HOW TO ACTIVATE SERVO BASED string ON ANDROID APP AND HC-06

CAN somebody help me build the code,Im trying to make 3 different bin with servo,I use the android app as a qr scanner.after qr scanner scan string one sent to servo a,rotate 180 degree then rotate back to 0 degree after(wait time 5 sec).same to other servo.Im am newbie.Sorry for my bad English. please fix my coding and im also using hc-06 bluetooth module

ASAP

TQ

#include <LiquidCrystal.h>
#include <Servo.h>
const int Servoa = 7;
const int Servob = 8;
const int Servoc = 9;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int pos = 0;
String readString;

void setup() {
Serial.begin(9600);
lcd.begin(16,2);

pinMode(Servoa, OUTPUT);
pinMode(Servoc, OUTPUT);
pos = digitalRead(Servo1);
lcd.setCursor(2,0);
lcd.print(“SAVE EARTH”);
lcd.setCursor(4,1);
lcd.print(“TQ”);

}

void loop() {
while (Serial.available()) {
delay(3);
char c = Serial.read();
readString += c;
}
if (readString.length() >0)
{
Serial.println(readString);
if (readString == “6vevqreytodthh1p1isg”)
{
digitalWrite(Servoa, pos = 0; pos <= 180; pos += 1);
}
{

lcd.setCursor(2,0);
lcd.print(“PLASTIC”);
lcd.setCursor(4,1);
lcd.print(“DETECTED!”);
delay(30000);
}
digitalWrite(Servoa, pos = 180; pos >= 0; pos -= 1);
lcd.setCursor(2,0);
lcd.print(“SAVE EARTH”);
lcd.setCursor(4,1);
lcd.print(“TQ”);
{ readString="";
}
}
}

{ if (readString.length() >0)
{
Serial.println(readString);
if (readString == “6vevqreytodthh1p1isg”)
{
digitalWrite(Servoa, pos = 0; pos <= 180; pos += 1);
}
{

lcd.setCursor(2,0);
lcd.print(“TINCAN”);
lcd.setCursor(4,1);
lcd.print(“DETECTED!”);
delay(30000);
}
digitalWrite(Servoa, pos = 180; pos >= 0; pos -= 1);
lcd.setCursor(2,0);
lcd.print(“SAVE EARTH”);
lcd.setCursor(4,1);
lcd.print(“TQ”);
{ readString="";
}
}
}
{ if (readString.length() >0)
{
Serial.println(readString);
if (readString == “6vevqreytodthh1p1isg”)
digitalWrite(Servoa, pos = 0; pos <= 180; pos += 1);
}
{

lcd.setCursor(2,0);
lcd.print(“PAPER”);
lcd.setCursor(4,1);
lcd.print(“DETECTED!”);
delay(30000);
}
digitalWrite(Servoa, pos = 180; pos >= 0; pos -= 1);
lcd.setCursor(2,0);
lcd.print(“SAVE EARTH”);
lcd.setCursor(4,1);
lcd.print(“TQ”);
{ readString="";
}
}
}

There are a few things wrong with hour post.

The code is not in code tags which makes it harder to work with.

The code will not compile because of several errors like:

pos = digitalRead(Servo1);

Where is Servo1 declared?

digitalWrite(Servoa, pos = 180; pos >= 0; pos -= 1);

Where did you see the syntax for digitalWrite like that?

A lot of the code is outside of any function which will prevent compilation. Use auto format (ctrl-t or in the IDE, Tools. Auto Format) to properly indent the code to see those mistakes.

Read the how to use this forum-please read sticky to see how to, properly, post code and some advice on how to ask a good question.

No one will fix the code for you, but we will help you fix it if you are willing to put in the work.