Can someone please explain to me what exactly is happening in this section of the demo code? I am under the impression that endTime should[?] make the Rapiro Robot stop doing his motion, but I can't seem to make that work.
The millis() function gives the current "time" (measured in milliseconds since the program started).
Somewhere before this part of the code, the variable endTime should have been set to what was then the current time plus the desired number of milliseconds until this code gets executed.
Could you post your complete program. Use the code tags (the "#" button above the smileys) to make it easier to read.