I wrote a code for triggering the ultrasonic SRF05 sensor
The trigger should be given for 10usec and give a delay of 50msec before next trigger
The process is running with the clock and is running continuously.
code:
Code:
process(check_bit,clk)
begin
if(clk'event and clk = '1') then
if (check_bit = X"74") then
if(count2 <= "000000000001001011000" ) then
trg2 <= '1';
count2 <=count2+"0000000000000000000001" ;
else
trg2 <= '0';
count2 <=count2+"0000000000000000000001" ;
if (count2 ="1001100010010110100000") then
count2<="0000000000000000000000";
end if;
end if;
end if;
end if;
end process;
Use a thing thing like variable = 1 then.... set variable to 1 at start of prog. After the pulse set variable to 0. Or for testing read a key, while key = 1 then...
Frank