Easydriver: Serial communication + local control

Hi Robin,
Thanks again.

I somewhat solved the problem using this logic:

void setup() {
.
.
.
/*  pinMode(MS1, OUTPUT);
  pinMode(MS2, OUTPUT);*/

}

void loop() {
  
  
   if(Serial.available()){
       pinMode(MS1, OUTPUT);
       pinMode(MS2, OUTPUT);
      ***Serial Control code***
      .
      .
      .

   }
      else {
      ***Local Control code***
      .
      .
      .

}

I did some basic tests and the code is working..

I will be thankful if you could post a snippet for:

I think it will be easier to extend the "serial" program to respond to your buttons rather than trying to merge what you have.

But before doing that you need to change the way you are reading the serial data because your use of WHILE block everything until it completes.

Thanks,

Z