Page 630 - 3-2
P. 630

begin
                            tx_reg<=8'b0100_0001; //A
                            tx_empty <= 0;
                            if(!tx_empty)
                            begin
                                    tx_cnt<=tx_cnt+1;
                                    if(tx_cnt==0) tx_out<=0;
                                    if (tx_cnt>0&&tx_cnt<9) tx_out<=tx_reg[tx_cnt-1];
                                    if (tx_cnt==9)
                                    begin
                                    tx_out<=1;
                                    tx_cnt<=0;
                                    tx_empty<=1;
                                    end
                            end
                    end
            end
            end
            endmodule


            ---------------------------------------------------
              나 라즈베리파이 관련 코드.
            서버


            import java.sql.*;
            import java.util.Arrays;
            import java.io.*;
            import java.net.*;
            import java.text.SimpleDateFormat;
            import java.util.Date;


            public class TestServer01 implements Runnable
            {
                    final static int s0 = 0; //s0 에 모기감지
                    final static int s1 = 1; //s1 에 모기감지
                    final static int s2 = 2; //s2 에 모기감지
                    final static int s3 = 3; //s3 에 모기감지
                    final static int s4 = 4; //s4 에 모기감지
                    final static int s5 = 5; //s5 에 모기감지
                    final static int s6 = 6; //s6 에 모기감지
                    final static int s7 = 7; //s7 에 모기감지
                    final static int clear = 8;     // 초기화


                    static int cs0=0,cs1=0,cs2=0,cs3=0,cs4=0,cs5=0,cs6=0,cs7=0;     // 출현 빈도 저장 변수




                                                         - 630 -
   625   626   627   628   629   630   631   632   633   634   635