I added the ‘while’ statement to create a STOP . Unable to correct the problem. Would appreciate some
help.Thanks to whoever gives this some consideration.
#include <Servo.h>
Servo myservo;
int servoPin = 9;
#define STpin 2
#define CWpin 3
#define CCWpin 4
int sc={10,150,21};
String scText;
int statusText;
//int CWBS, CCWBS;
int STBS,CWBS,CCWBS;
void setup() {
Serial.begin(9600);
pinMode(STpin,INPUT_PULLUP);
pinMode(CWpin,INPUT_PULLUP);
pinMode(CCWpin,INPUT_PULLUP);
myservo.attach(servoPin);
myservo.write(sc[1]);
statusText=1;
while (digitalRead (buttonSTpin)) {} //error message’buttonSTpin’was not declaired in this scope
Serial.println(“press the buttonSTpin(0)”);
}
void loop() {
CCWBS = digitalRead(CCWpin);
CWBS = digitalRead(CWpin);
if (CCWBS ==LOW)
{
servoCommand (0);
}else if(CWBS ==LOW)
{
servoCommand(1);
}
Serial.println(scText[statusText]);
delay(50);
}
void servoCommand(int n)
{
myservo.write(sc[n]);
Serial.println(")");
}