Wow! I can’t find the thread but someone had this problem before! (I’ll edit it in once I find it). It comes down to the fact that the serial Port just skips output, randomly, for whatever reason. Our previous fix was to just test whether or not list
actually contained a second element.
I know you’ve must have spent a lot of time on this, but I actually believe someone’s made a very polished library that does what you want and more (yay?).
But if you’re just using this as a learning exercise, we can still tackle the original problem
EDIT:
Here’s the link: [SOLVED] ArrayIndexOutOfBoundsException: 1