I made some experiments ; the window roll-up (or roll-down) in about 6 seconds. I'm thinking to something like this :
...............
eeprom 0, [0, 0]
..............
read 0, calibra.byte0
read 1, calibra.byte1
if calibra =0 then
high rel1
....read U for maximum 7-8 seconds
....identify the highest value of U
....write this value in eeprom for further using as max.value in check:

low rel1
endif
..............
main:
....etc,etc.

Help, please, with the red lines; starting with what ? I use "search" but perhaps not so good ; I can't find one "clue" ! Thanks for supporting me !