Merge branch 'devel_freefall' of gitlab.enterpriselab.ch:besterma/asyd into devel_freefall

devel_freefall
Jonas Arnold 3 years ago
commit b84f31dea7
  1. 20
      ASYD_Safety/Ada_Microbit/examples/MicroBit/jumper/src/main.adb

@ -64,21 +64,25 @@ begin
Display.Clear;
loop
if Buttons.State (Button_A) = Pressed then
DO_2_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Up);
DO_4_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Up);
Display.Clear;
Display.Display ('0');
end if;
if Buttons.State (Button_B) = Pressed then
if Buttons.State (Button_A) = Released and Buttons.State (Button_B) = Released and not FreeFallCondition then
DO_1_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Down);
DO_2_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Down);
DO_3_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Down);
DO_4_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Down);
end if;
if Buttons.State (Button_A) = Pressed then
DO_1_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Up);
DO_3_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Up);
Display.Clear;
Display.Display ('X');
end if;
if Buttons.State (Button_B) = Pressed then
DO_2_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Up);
DO_4_Pt.Set_Pull_Resistor(Pull => HAL.GPIO.Pull_Up);
Display.Clear;
Display.Display ('0');
end if;
-- Read the accelerometer data

Loading…
Cancel
Save