【正文】
c500 then miao_2=39。139。 else miao_2=39。039。 end if。 else c:=2500。miao_5=39。139。 end if。 end if。end process。 guang dian jian ce kong zhi xi tong process(fuwei,Hz_500,guangdian) variable c : integer range 0 to 500。 begin if fuwei=39。139。 then c:=0。 elsif rising_edge(Hz_500) then if c500 then c:=c+1。 elsif qianduan=39。039。 then c:=500。 if guangdian=01or zhuanwan=39。139。 then control(3 downto 2)=10。 elsif guangdian=10 then control(3 downto 2)=01。 else control(3 downto 2)=00。wancheng=39。139。 end if。 elsif zuozhuan=39。139。 then control(3 downto 2)=10。 elsif youzhuan=39。139。 then control(3 downto 2)=01。 else control(3 downto 2)=00。 end if。 end if。end process。 lu cheng ji shu process(Hz_500,Lucheng)begin if rising_edge(Hz_500) then if lucheng=39。039。 then Luchengjishu=39。039。 else Luchengjishu=39。139。 end if。 end if。end process。process(fuwei,Luchengjishu)variable c : integer range 0 to 32752。begin if fuwei=39。139。 then c:=0。 elsif rising_edge(luchengjishu) then c:=c+4。 end if。 luchengxianshi=c。end process。 yi ma xian shi process(Hz_100,luchengxianshi,clk,xuanzxshi,shijianxianshi,wancheng,wanchengshijian)variable c : integer range 0 to 32752。variable dd,ddd,dddd,ddddd : integer range 0 to 10。begin if Hz_100=39。139。 then dd:=0。ddd:=0。dddd:=0。ddddd:=0。 if xuanzxshi=39。039。 then if wancheng=39。039。 then c:=shijianxianshi。 else c:=wanchengshijian。 end if。 else c:=luchengxianshi。 end if。 elsif rising_edge(clk) then if c9999 then c:=c10000 。 ddddd:=ddddd+1。 elsif c999 then c:=c1000 。 dddd:=dddd+1。 elsif c99 then c:=c100 。 ddd:=ddd+1。 elsif c9 then c:=c10 。 dd:=dd+1。 elsif xuanzxshi=39。039。then p1=10。p2=10。p3=11。p4=c。p5=dd。 elsif ddddd=0 and dddd=0 and ddd=0 and dd=0 then p1=10。p2=10。p3=c。p4=10。p5=10。 elsif ddddd=0 and dddd=0 and ddd=0 then p1=10。p2=10。p3=c。p4=dd。p5=10。 elsif ddddd=0 and dddd=0 then p1=10。p2=c。p3=dd。p4=ddd。p5=10。 elsif ddddd=0 then p1=10。p2=c。p3=dd。p4=ddd。p5=dddd。 else p1=c。p2=dd。p3=ddd。p4=dddd。p5=ddddd。 end if。 end if。end process。process(kaishi,Hz_500)variable c : std_logic_vector(2 downto 0)。begin if kaishi=39。039。 then c:=000。weixuan=1111111。pt=10。 elsif rising_edge(Hz_500) then c:=c+1。 if c=000 then weixuan=1111110。pt=p1。 elsif c=001 then weixuan=1111101。pt=p2。 elsif c=010 then weixuan=1111011。pt=p3。 elsif c=011 then weixuan=1110111。pt=p4。 elsif c=100 then weixuan=1101111。pt=p5。c:=111。 else null。 end if。 end if。end process。process(pt)begin case pt is when 0 = led=0000001。 when 5 = led=0100100。 when 1 = led=1001111。 when 6 = led=0100000。 when 2 = led=0010010。 when 7 = led=0001111。 when 3 = led=0000110。 when 8 = led=0000000。 when 4 = led=1001100。 when 9 = led=0000100。 when 11= led=1111110。 when others = led=1111111。 end case。end process。end Behavioral。附錄二(元器件清單)FPGA 小板元器件清單元器件數(shù)量元器件數(shù)量LED 數(shù)碼管6個8路選擇開關(guān)1個三極管 C90127個按鍵6個發(fā)光二極管8個排阻 BI M91103J6172個XILINX芯片 1個二極管 4007 2個電阻 74K歐姆21個電阻 150歐姆8個外圍電路元器件清單元器件型號數(shù)量參數(shù)備注超聲波發(fā)射器400ST(329)1個超聲波接收器M0321個光電檢測透視式1個光電檢測反射式2個光敏三極管3個14腳底座10個二極管41483個可調(diào)電位器1025個1K可調(diào)電位器1035個10K可調(diào)電位器1045個100K三極管56092個三極管56102個三極管901312個電容1043個電容2233個芯片4N254個光偶芯片74LS146塊芯片LM3932個電壓比較器電阻10個電阻4個10M電阻4個2M.電阻1個1M電阻4個220K電阻1個33K電阻4個0K2附錄三(使用說明)該智能化電動小車操作簡單,要它運行時只須打開電源開關(guān),小車便可以自動按照軌跡運行