From 2d21f2312d972d740c81fd38d7114afc2ef34017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Tue, 8 Oct 2024 14:55:55 +0200 Subject: [PATCH] Revert "Invert tube direction" This reverts commit 5fd7e91ec73122369b436024c7fe334fe5f61594. --- ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.bd | 4 ++-- ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.esdl | 4 ++-- ASCET-DEVELOPER/BalanceTube/tests/BalanceTubeTest.esdl | 4 ++-- .../src-gen/src/hardware_HandDistanceSensor_Automatic.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.bd b/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.bd index 5dce0c5..32e663f 100644 --- a/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.bd +++ b/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.bd @@ -90,13 +90,13 @@ blockdiagramSpecification Main { inPin } } - literal Numeric "1.0" at (171, 203) size (49, 0) { + literal Numeric "0.0" at (171, 203) size (49, 0) { label at (0, 4) outPin { connection_2 } } - literal Numeric "0.0" at (171, 223) size (49, 0) { + literal Numeric "1.0" at (171, 223) size (49, 0) { label at (0, 4) outPin { connection_1 diff --git a/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.esdl b/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.esdl index fa48b4f..1750151 100644 --- a/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.esdl +++ b/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.esdl @@ -13,8 +13,8 @@ writes Signals.handPosition { characteristic real adcMax = 2000.0; @thread - @generated("blockdiagram", "931aadb8") + @generated("blockdiagram", "54d31754") public void read() { - Signals.handPosition = min(max(m.map(Signals.adcHandPosition, adcMin, adcMax, 1.0, 0.0), 0.0), 1.0); // Main/read 1 + Signals.handPosition = min(max(m.map(Signals.adcHandPosition, adcMin, adcMax, 0.0, 1.0), 0.0), 1.0); // Main/read 1 } } diff --git a/ASCET-DEVELOPER/BalanceTube/tests/BalanceTubeTest.esdl b/ASCET-DEVELOPER/BalanceTube/tests/BalanceTubeTest.esdl index dbe3de4..5405f1a 100644 --- a/ASCET-DEVELOPER/BalanceTube/tests/BalanceTubeTest.esdl +++ b/ASCET-DEVELOPER/BalanceTube/tests/BalanceTubeTest.esdl @@ -15,7 +15,7 @@ reads Signals.handPosition { public void handPositionNormalization() { Signals.adcHandPosition = sensor.adcMin; sensor.read(); - assert.assertDoubleEqual(Signals.handPosition, 1.0); + assert.assertDoubleEqual(Signals.handPosition, 0.0); Signals.adcHandPosition = (sensor.adcMax + sensor.adcMin) / 2; sensor.read(); @@ -23,6 +23,6 @@ reads Signals.handPosition { Signals.adcHandPosition = sensor.adcMax; sensor.read(); - assert.assertDoubleEqual(Signals.handPosition, 0.0); + assert.assertDoubleEqual(Signals.handPosition, 1.0); } } diff --git a/STM32CubeIDE/GithubActions_ST/src-gen/src/hardware_HandDistanceSensor_Automatic.c b/STM32CubeIDE/GithubActions_ST/src-gen/src/hardware_HandDistanceSensor_Automatic.c index 56e1bb9..74836bd 100644 --- a/STM32CubeIDE/GithubActions_ST/src-gen/src/hardware_HandDistanceSensor_Automatic.c +++ b/STM32CubeIDE/GithubActions_ST/src-gen/src/hardware_HandDistanceSensor_Automatic.c @@ -111,7 +111,7 @@ void hardware_HandDistanceSensor_Automatic_read (void) float32 _t1real32; _t1real32 - = hardware_MappingUtil_Automatic_map(model_Signals_adcHandPosition__hardware_HandDistanceSensor_Automatic_read, adcMin_VAL, adcMax_VAL, 1.0F, 0.0F); + = hardware_MappingUtil_Automatic_map(model_Signals_adcHandPosition__hardware_HandDistanceSensor_Automatic_read, adcMin_VAL, adcMax_VAL, 0.0F, 1.0F); model_Signals_handPosition__hardware_HandDistanceSensor_Automatic_read = ((_t1real32 >= 0.0F) ? (((_t1real32 <= 1.0F) ? _t1real32 : 1.0F)) : 0.0F); }