This version builds each channel data to an array of 100 elements. Each channel array is then having its 10 highest readings removed and computed the average of the remains.
The current program waits 5 seconds before writing the data to a file but I'm collecting data when my device is off. I don’t know how to solve this. Perhaps I need to read my channel when my trigger goes high and only for 2 seconds so that I don’t get data that is junk.