------------------------------------------------------------------------------
-- Affaire :   ROBOT
-- Carte :		Camera
-- EPLD :		Epld_
-- Fonction : 	Ball Finder v2 !
-- Author :		EIRBOT 2003 ENSEIRB
-- Date :		25.10.2002
------------------------------------------------------------------------------

library IEEE, work;
use IEEE.std_logic_1164.all;
use ieee.std_logic_unsigned.all; 
use ieee.numeric_std.all; 
use work.all;

entity cligno is
	port (
		LLC2A     : in std_logic;
		LLC2B     : in std_logic;

		LED1  : out std_logic;
		LED2 : out std_logic
	);

end cligno;


architecture structure of cligno is

	signal cptA : integer range 1 to 6750000;
	signal cptB : integer range 1 to 6750000;

	signal hopA : std_logic;
	signal hopB : std_logic;

	begin

	LED1 <= hopA;
	--LED1 <= LLC2A;
	LED2 <= hopB;
	--LED2 <= LLC2B;
-------------------------------------------------------------------------------
	comptage_A : process (LLC2A)
	begin
		if rising_edge(LLC2A) then
			if (cptA >= 6750000) then
				cptA <= 1;
				hopA <= not(hopA);
			else
				cptA <= cptA + 1;
			end if;
		end if;
	end process;
-------------------------------------------------------------------------------
	comptage_B : process (LLC2B)
	begin
		if rising_edge(LLC2B) then
			if (cptB >= 6750000) then
				cptB <= 1;
				hopB <= not(hopB);
			else
				cptB <= cptB + 1;
			end if;
		end if;
	end process;
-------------------------------------------------------------------------------
	end structure;
