Page 56 - MDP2020-1
P. 56

|    인천전자마이스터고등학교  ·············································································································
            50

            servo3Pos  =  dataInS.toInt();
            if(servo3Ppos  >  servo3Pos)  {
            for(int  j  =  servo3Ppos;  j  >=  servo3Pos;  j--)  {
            servo_3.writeMicroseconds(j);

            }
            }
            if(servo3Ppos  <  servo3Pos)  {
            for(int  j  =  servo3Ppos;  j  <=  servo3Pos;  j++)  {

            servo_3.writeMicroseconds(j);
            }
            }
            servo3Ppos  =  servo3Pos;
            }
            }

            }


            else  if(!isBluetoothmode)  {
            Button();



            if(!playmode)
            {
            if(currentMillis  -  previousMillis1  >  25)
            {
            if  (arrayStep  <  top)

            {
            previousMillis1  =  currentMillis;
            readPot();
            mapping();
            move_servo();

            }
            }
            }


            else  if(playmode)

            {
            if(Step)
            {
            digitalWrite(13,  HIGH);
            if  (arrayStep  <  arrayMax)

            {
            arrayStep  +=  1;
   51   52   53   54   55   56   57   58   59   60   61