Forum Discussion
Altera_Forum
Honored Contributor
11 years agoLIBRARY IEEE;
USE IEEE.std_logic _1164.all; ENTITY streetlight IS PORT (D, resetn,clock: IN STD_LOGIC; Q :OUT STD_LOGIC); END flipflop; ARCHITECTURE Behaviour of streetlight IS BEGIN PROCESS (Clock,resetn) BEGIN IF Clock 'EVENT AND CLOCK='1' THEN IF resetn='0' THEN Q<='0'; ELSE Q<=D; END IF; END IF; END PROCESS; END BEHAVIOR; I have done this and I have assigned pin to produce d output on an led on d de2 board.when i push d switch down d led comes on when i push it up d led goes off.but now I want to use an external ldr to generate analog input that will b converted into digital form whose output will turn on an external led.that is when it is dark d ldr will generate input signal that will turn on d led and when if is day d ldr will generate signal to turn off d led. Pls put me through