Altera_Forum
Honored Contributor
14 years agoDE1 Board Read KEY
I need to press and hold key 1 and than press key 2 to increase value. How to Read keys only if both keys are pressed. This is what is have which is not working correct. (programming languages vhdl).
if key(0) and key(1) are pessed do somthing PORT ( KEY : IN STD_LOGIC_VECTOR(3 DOWNTO 0); ); SIGNAL A, B, C, D : STD_LOGIC_VECTOR(1 DOWNTO 0); BEGIN A <= Not(KEY(0) & KEY(1)); B <= Not(KEY(0) & KEY(2)); C <= Not(KEY(0) & KEY(3)); Readkey: process(KEY) begin if (A = 1) then D <= "00"; -- 1 end if; if (B = 1) then D <= "01"; -- 2 end if; if (C = 1) then D <= "10"; -- 3 end if; end process;