Catalex code, integration with analog reading should trigger a sound to play..

Okay so I looked into state change code for analog inputs and found this...

    unsigned int x;
    unsigned int samples = 1000;
    unsigned long int accumulator = 0; // initialize accumulator
    for (x = 0; x < samples; x++) {
        accumulator += analogRead(channel);
    }
    return accumulator / samples;

Was this what you were referring to? I'm afraid I have reached my limit of understanding what to do here.Honestly, I just cant make the transition to apply or integrate this code because I need more brains. Assistance is greatly appreciated!! :slight_smile: