Forum Discussion
Altera_Forum
Honored Contributor
15 years agoDE2 push buttons question
I have a simple counter in VHDL for DE2-115 (should work with any DE2). KEY0 starts counting, KEY1 stops, KEY2 resets. The output is displayed on 7-seg LEDs HEX0 - HEX3 in hexa digits (to be simple m...
Altera_Forum
Honored Contributor
15 years agoI have changed the process like this:
buttons_process:process (key)
begin
if ((key(0) = '0' and key(0)'event)) then
run <= not run; -- switch ON/OFF does't work properly - why ??
reset <= '0';
end if;
if (key(1) = '0') then
hex6 <= "1000000"; -- 0
reset <= '1';
else
hex6 <= "1111001"; -- 1
end if;
end process;but the key is still not toggling properly. If I change key(0) detection to rising edge (key(0) = '1' and key(0)'event) the key shouldn't be working from my opinion. But it is the same inproper toggling. What am I missing ? Thanks for reply.