Page 500 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 500
인천전자마이스터고 전자회로설계과
//라즈베리파이에서 처리한 음성명령을 통해 voice_buf저장
always@(posedge clk_div,negedge reset) //음성인식 [0] 1층 , [1] 2층 [2] 3층
begin
if(!reset) voice_buf <= 3'b000;
else
begin
if(voice_command_one==1) voice_buf[0] <= 1;
//1층 음성명령 인식후 1값을 input으로 받아 buf에 기억
else if(voice_command_two==1) voice_buf[1] <= 1;
//2층 음성명령 인식후 1값을 input으로 받아 buf에 기억
else if(voice_command_three==1) voice_buf[2] <= 1;
//3층 음성명령 인식후 1값을 input으로 받아 buf에 기억
else
begin
if(state_c==STOP) //STOP 상태 일때
begin
case(pos_c)
1 : voice_buf[0] <= 0;
2 : voice_buf[1] <= 0;
3 : voice_buf[2] <= 0;
default : voice_buf <= 3'b000;
endcase
end
else voice_buf<= voice_buf;
end
- 493 -