Page 352 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 352

SoftPwm.softPwmWrite(leftMotor1, 0); //pwm 제어
                                    SoftPwm.softPwmWrite(leftMotor2, 0); //pwm 제어
                                    break;
                                }
                            }
                            int Servo1 = Integer.parseInt(tmp.split(",")[2].split(":")[1]);
                            int Servo2 = Integer.parseInt(tmp.split(",")[3].split(":")[1]);
                            int Servo3 = Integer.parseInt(tmp.split(",")[4].split(":")[1]);
                            int Servo4 = Integer.parseInt(tmp.split(",")[5].split(":")[1]);
                            int Servo5 = Integer.parseInt(tmp.split(",")[6].split(":")[1]);
                            int Servo8 = Integer.parseInt(tmp.split(",")[5].split(":")[1]);

                            int Gun = Integer.parseInt(tmp.split(",")[7].split(":")[1]);
                            int Light = Integer.parseInt(tmp.split(",")[8].split(":")[1]);
                            int MetalDetector = Integer.parseInt(tmp.split(",")[9].split(":")[1]);
                            //전송된 문자열을 분해
                            if (Servo1 != tmpservo1) {
                                SoftPwm.softPwmWrite(servo1, Servo1);
                            }
                            if (Servo2 != tmpservo2) {
                                SoftPwm.softPwmWrite(servo2, Servo2);
                            }
                            if (Servo3 != tmpservo3) {
                                SoftPwm.softPwmWrite(servo3, Servo3);
                            }
                            if (Servo4 != tmpservo4) {
                                SoftPwm.softPwmWrite(servo4, Servo4);
                            }
                            if (Servo5 != tmpservo5) {
                                SoftPwm.softPwmWrite(servo5, Servo5);

                            }
                            if (Servo8 != tmpservo8) {
                                SoftPwm.softPwmWrite(servo8, 10+Servo8);
                                System.out.println(10+Servo8);
                            }
                            if (Gun == 0) {
                                gunPin.low();
                            } else {
                                gunPin.high();
                            }




                                                         -  345  -
   347   348   349   350   351   352   353   354   355   356   357