Skip to content

Instantly share code, notes, and snippets.

@Aunsiels
Last active August 29, 2015 14:07
Show Gist options
  • Save Aunsiels/a741ee909065765d30c6 to your computer and use it in GitHub Desktop.
Save Aunsiels/a741ee909065765d30c6 to your computer and use it in GitHub Desktop.
Cours Ada stm32
with Ada.Real_Time; use Ada.Real_Time;
with Stm32.GPIO; use Stm32.GPIO;
with Stm32.RCC; use Stm32.RCC;
pragma Elaborate_All (Stm32.GPIO);
procedure Cours1 is
--Definir la Pin
Pin : constant Pin_Type := (GPIOD, 12);
begin
--Configurer la pin comme une pin de sortie
Setup_Out_Pin(Pin);
loop
--Allumer la pin, attendre un peu, eteindre la pin, attendre un peu
Set_Pin(Pin,True);
delay until Clock + To_Time_Span (1.0);
Set_Pin(Pin,False);
delay until Clock + To_Time_Span (1.0);
end loop;
end Cours1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment