Develop algorithm to count peaks of I2C magnetometer readings

Closed - This job posting has been filled.

Job Description

I am getting magnetic field readings from a magnetometer's I2C two wire data connection to an Arduino microprocessor. The data graph goes back and forth from a horizontal line to a sine wave as the magnetic field changes. I need to count the peaks of the sine wave.