"Constant Image Height" screen masking control code opinions

Maybe I should have been more clear when I said: “I pieced together a sketch from several sources (including this forum) “ in post #1,

And when I reiterated it in post #3: “*Again, I'm new at this and literally pieced together the code from at least five separate examples of using IR remotes, limit switches, encoders, direction control and memory position. I had to adapt sketches from push button to IR input. Try and decide what parts of some code to throw out hoping that just because it didn't seem to effect what I was doing that some how it wasn't still relevant. I got it to work from educated guesses, but mostly trial and error.” *

I didn’t write the program, I more or less assemble/modified it. I do understand most of how it works through trial and error, but not all.

The majority of the code came mostly from these sources. Written by people a lot better at this than I am.

Code & Syntax Overview

Limit Switches - cattledog

https://forum.arduino.cc/index.php?topic=506458.30

Receiving with the IRremote library

Programmable Positions

https://shiftautomation.com/linear-actuator-control-programmable-positions

What I can do is look at examples and modify them to work in my situation. I already have something that works “as is”.

What I was hoping for was that members of this forum would critique what I did and maybe point out to me some unforeseen shortcomings or where it could be improved or simplified.

I do understand the importance of being able to write my own code (and I will), and but right now I have to button this project up.

I also appreciate your quote “Two or three hours spent thinking and reading documentation solves most programming problems.”