#include 255, 255, 254, 254, 254, 253, 253, 253,

#include SoftwareSerial BT(12,13); //TX, RX respetivelyint ENABLE1 = 5;int ENABLE2 = 6;int ENABLE3 = 7; int INPUT1 = 9;int INPUT2 = 10;int INPUT3 = 11;  int pwmSin = {128, 132, 136, 140, 143, 147, 151, 155, 159, 162, 166, 170, 174, 178, 181, 185, 189, 192, 196, 200, 203, 207, 211, 214, 218, 221, 225, 228, 232, 235, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 249, 250, 250, 251, 252, 252, 253, 253, 253, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 253, 253, 253, 252, 252, 251, 250, 250, 249, 248, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 249, 250, 250, 251, 252, 252, 253, 253, 253, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 254, 254, 253, 253, 253, 252, 252, 251, 250, 250, 249, 248, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 235, 232, 228, 225, 221, 218, 214, 211, 207, 203, 200, 196, 192, 189, 185, 181, 178, 174, 170, 166, 162, 159, 155, 151, 147, 143, 140, 136, 132, 128, 124, 120, 116, 113, 109, 105, 101, 97, 94, 90, 86, 82, 78, 75, 71, 67, 64, 60, 56, 53, 49, 45, 42, 38, 35, 31, 28, 24, 21, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 8, 7, 6, 6, 5, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 8, 7, 6, 6, 5, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 24, 28, 31, 35, 38, 42, 45, 49, 53, 56, 60, 64, 67, 71, 75, 78, 82, 86, 90, 94, 97, 101, 105, 109, 113, 116, 120, 124}; int CurrentsweepA;int CurrentsweepB;int CurrentsweepC;int sineArraySize;int inc = 0;int i ;void setup() { BT.begin(9600); Serial.begin(9600);   setPwmFrequency(INPUT1);   setPwmFrequency(INPUT2);  setPwmFrequency(INPUT3);   pinMode(INPUT1, OUTPUT);   pinMode(INPUT2, OUTPUT);   pinMode(INPUT3, OUTPUT);     pinMode(ENABLE1, OUTPUT);   pinMode(ENABLE2, OUTPUT);   pinMode(ENABLE3, OUTPUT);     digitalWrite(ENABLE1, HIGH);  digitalWrite(ENABLE2, HIGH);  digitalWrite(ENABLE3, HIGH);    sineArraySize = sizeof(pwmSin)/sizeof(int);    int phaseShift = sineArraySize / 3;          CurrentsweepA = 0;  CurrentsweepB = CurrentsweepA + phaseShift;  CurrentsweepC = CurrentsweepB + phaseShift;   sineArraySize–; // Convert from array Size to last PWM array number}//———————————————————————–// void loop() {  while (BT.available()){  //Check if there is an available byte to read  delay(10); //Delay added to make thing stable  int c = BT.read(); //Conduct a serial read  c = map(c, 0, 255, 0, 1023);  Serial.println(c); analogWrite(INPUT1, pwmSinCurrentsweepA);  analogWrite(INPUT2, pwmSinCurrentsweepB);  analogWrite(INPUT3, pwmSinCurrentsweepC);    if (c == 1014)  {   inc = 1;   Serial.println(“clock wise direction”);      digitalWrite(ENABLE1, LOW);       digitalWrite(ENABLE2, LOW);       digitalWrite(ENABLE3, LOW);       delay(1000);         digitalWrite(ENABLE1, HIGH);         digitalWrite(ENABLE2, HIGH);         digitalWrite(ENABLE3, HIGH);  }  else if (c == 1018)  {    inc = -1;         Serial.println(“Anti clock wise direction”);       digitalWrite(ENABLE1, LOW);       digitalWrite(ENABLE2, LOW);       digitalWrite(ENABLE3, LOW);       delay(1000);         digitalWrite(ENABLE1, HIGH);         digitalWrite(ENABLE2, HIGH);         digitalWrite(ENABLE3, HIGH);  }  CurrentsweepA = CurrentsweepA + inc;  CurrentsweepB = CurrentsweepB + inc;  CurrentsweepC = CurrentsweepC + inc;   //Check for lookup table overflow and return to opposite end if necessary  if(CurrentsweepA > sineArraySize)  CurrentsweepA = 0;  if(CurrentsweepA < 0)  CurrentsweepA = sineArraySize;   if(CurrentsweepB > sineArraySize)  CurrentsweepB = 0;  if(CurrentsweepB < 0)  CurrentsweepB = sineArraySize;   if(CurrentsweepC > sineArraySize)  CurrentsweepC = 0;  if(CurrentsweepC < 0) CurrentsweepC = sineArraySize;                if (  c>=0 && c<= 1000)           {       Serial.println("speed is varing");          delay(c);          i = c;          }         else if (c == 1006)         {          i = i + 100;          Serial.println(i);          Serial.println("speed inc");         }         else if (c == 1010)         {                 i = i - 100;          Serial.println(i);          Serial.println("speed dec");         }             c = 0;  }}   void setPwmFrequency(int pin) {  if(pin == 5 || pin == 6 || pin == 9 || pin == 10) {    if(pin == 5 || pin == 6) {      TCCR0B = TCCR0B & 0b11111000 | 0x01;    } else {      TCCR1B = TCCR1B & 0b11111000 | 0x01;    }  }  else if(pin == 3 || pin == 11) {    TCCR2B = TCCR2B & 0b11111000 | 0x01;  }}