diff --git a/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.bd b/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.bd index e6d2b84..090c0c0 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 @@ -118,4 +118,4 @@ blockdiagramSpecification Main { inPin connection_10 } } -} +} \ No newline at end of file diff --git a/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.esdl b/ASCET-DEVELOPER/BalanceTube/hardware/HandDistanceSensor.esdl index fa48b4f..b50ed9e 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 } -} +} \ No newline at end of file diff --git a/ASCET-DEVELOPER/BalanceTube/tests/BalanceTubeTest.esdl b/ASCET-DEVELOPER/BalanceTube/tests/BalanceTubeTest.esdl index ac9d124..58bb147 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); }