Without knowing Protothread in detail: It is most likely handling the threadchange during PT_SLEEP(), which you are only executing after one "sweep" (one of the inner for loops), not giving any opportunity to change to the other thread.
Additionally this way you don't have any delay in the inner for loops, thus they get executed very fast. Faster ...
That is an excellent project. Great work.
Some suggestions for improvement. You could use a enum class byte instead of a String for the drawer position and the drawer moving direction:
/* Allows the program to keep track of the last known position of the drawer */
enum class DrawerPositions : byte
} drawerPosition = DrawerPositions::Closed;...
I know this was opened years ago now but I just wanted to add some clarification. When I started this project and created this question I had 0 understanding of software development and didn't understand the code I was writing at the time. Now 3 years later I have revised this project multiple times.
The logic for a project like this is pretty simple, but if ...