I see that you have different versions of your sketch dependencies installed on the computer used by each IDE:
Using core 'esp32' from platform in folder: C:\Users\aehrh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14
Bibliothek BluetoothSerial in Version 2.0.0 im Ordner: C:\Users\aehrh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\BluetoothSerial wird verwendet
Bibliothek Preferences in Version 2.0.0 im Ordner: C:\Users\aehrh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Preferences wird verwendet
Bibliothek PWMOT im Ordner: C:\Users\aehrh\Documents\Arduino\libraries\PWMOT (veraltet) wird verwendet
Bibliothek AccelStepper in Version 1.64 im Ordner: C:\Users\aehrh\Documents\Arduino\libraries\AccelStepper wird verwendet
Bibliothek SPI in Version 2.0.0 im Ordner: C:\Users\aehrh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\SPI wird verwendet
Bibliothek Wire in Version 2.0.0 im Ordner: C:\Users\aehrh\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire wird verwendet
Bibliothek MPU6050_light in Version 1.2.1 im Ordner: C:\Users\aehrh\Documents\Arduino\libraries\MPU6050_light wird verwendet
Using core 'esp32' from platform in folder: C:\Users\Andreas\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6
Bibliothek BluetoothSerial in Version 1.0 im Ordner: C:\Users\Andreas\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\BluetoothSerial wird verwendet
Bibliothek Preferences in Version 1.0 im Ordner: C:\Users\Andreas\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\Preferences wird verwendet
Bibliothek PWMOT im Ordner: C:\Users\Andreas\Documents\Arduino\libraries\PWMOT (legacy) wird verwendet
Bibliothek AccelStepper in Version 1.61 im Ordner: C:\Users\Andreas\Documents\Arduino\libraries\AccelStepper wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Users\Andreas\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\SPI wird verwendet
Bibliothek Wire in Version 1.0.1 im Ordner: C:\Users\Andreas\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\Wire wird verwendet
Bibliothek MPU6050_light in Version 1.2.1 im Ordner: C:\Users\Andreas\Documents\Arduino\libraries\MPU6050_light wird verwendet
My hypothesis is that the cause of the different behavior you are seeing between the program from the sketch compiled with each IDE version is actually differences in these dependencies rather. The fact that a different IDE version is used in each environment is irrelevant.
You can test this by installing the same versions of the dependencies on the computer where you are using Arduino IDE 2.3.1 as you have installed in the "functional" environment on the Windows 8 PC.
I'll provide instructions you can follow to do that:
Install "esp32" Boards Platform Version 1.0.6
- Select Tools > Board > Boards Manager... from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
- Scroll down through the list of boards platforms until you see the "esp32" entry.
- Select "1.0.6" from the drop-down menu in the "esp32" entry.
- Click the "INSTALL" button at the bottom of the entry.
- Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:
Successfully installed platform ...
Install "AccelStepper" Library Version 1.61
- Select File > Quit from the Arduino IDE menus if it is running.
- Delete the folder at the following path:
C:\Users\aehrh\Documents\Arduino\libraries\AccelStepper
Please be careful when deleting things from your computer. When in doubt, back up! - Start Arduino IDE.
- Select Sketch > Include Library > Manage Libraries... from the Arduino IDE menus to open the "Library Manager" view in the left side panel.
- Type
AccelStepperin the "Filter your search..." field. - Scroll down through the list of libraries until you see the "AccelStepper" entry.
- Click the ˅ icon on the right side of the version selector in the "AccelStepper" entry.
The version selector dropdown will open. - Select "1.61.0" from the dropdown.
- Click the "INSTALL" button at the bottom of the entry.
- Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:
ⓘ Successfully installed library ...
After doing that, upload the sketch to your board again. Does the program now behave as expected?