Skip to content

Instantly share code, notes, and snippets.

@Jay-davisphem
Created January 14, 2025 11:01
Show Gist options
  • Save Jay-davisphem/d286788b11584b4d3e4f7c59ec948987 to your computer and use it in GitHub Desktop.
Save Jay-davisphem/d286788b11584b4d3e4f7c59ec948987 to your computer and use it in GitHub Desktop.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity WeatherStation is
Port (
switches : in STD_LOGIC_VECTOR(1 downto 0); -- Two switches
lcd_data : out STD_LOGIC_VECTOR(7 downto 0) -- Data sent to LCD
);
end WeatherStation;
architecture Behavioral of WeatherStation is
begin
process(switches)
begin
if switches(0) = '1' then
lcd_data <= "00110101"; -- Simulated Temp: 25°C (in binary)
else
lcd_data <= "00000000"; -- Default: 0°C
end if;
end process;
end Behavioral;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment