Demo of merging the code from two sketches

There are many other changes that could be considered but I have deliberately stayed as close as possible to the original code from the examples.

The thing that you did that separates you from those that can't figure out how to merge two sketches was to start with an understanding of:

  1. What the original sketches do
  2. What the merged sketch should do.

Without those two items, no amount of explanation is useful.

Nice try, though.