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

}
                                    }
                                }.start();
                            }

                            tmpservo1 = Servo1;
                            tmpservo2 = Servo2;
                            tmpservo3 = Servo3;
                            tmpservo4 = Servo4;
                            tmpservo5 = Servo5;
                            tmpservo8 = Servo8;
                            tmprightMotor = rightMotor;
                            tmpleftMotor = leftMotor;
                        }
                    }
                    //만약 값이 변했으면 pwm이나 gpio의 상태를 바꾼다
                }
                // 소리전송
                class Transmit implements Runnable {

                    byte[] buf = new byte[buffersize];
                    int count;

                    @Override
                    public void run() {
                        while (Ttrigger) {
                            if ((count = targetDataLine.read(buf, 0, buf.length)) != -1) {
                                try {
                                    soundOutputStream.write(buf, 0, count);
                                    soundOutputStream.flush();
                                } catch (IOException e) {
                                    // TODO Auto-generated catch block
                                    try {
                                        init();
                                    } catch (LineUnavailableException | IOException e1) {
                                        // TODO Auto-generated catch block
                                        try {
                                            soundServerSocket.close();
                                            soundSocket.close();
                                            targetDataLine.close();
                                            init();




                                                         -  347  -
   349   350   351   352   353   354   355   356   357   358   359