The Tricorduino_3.0_V1 file is the first reasonably clean version of the sketch. Even so, it is far from being completely clean and optimized. I must confess that I worked on this code for over 2 years eliminating conflicts and interference between sensors. Such a task carried out over such a long period makes us lose our sense of the details. It will take me a long time to optimize this code and get it completely clean. Eventually if someone with knowledge proposes to do this, he will have all my blessing.
Lightning sensor is working but requires better sensitivity control. In the next few days I will be doing tests and implementing code improvements to avoid excessive disturbances. It's a good thing we're in the rainy season here.