Skip to main content

sampler.stop()

Stops the ADC and sends the current buffer to the callback for processing

Availability

Device
Not available on the imp004m, imp005 or imp006

Returns

Nothing

Description

This method stops the sampler. If there is a partially-filled buffer at the moment sampling stops, it will be sent to the callback registered with sampler.configure(), with the callback’s byteCount parameter indicating how much data the buffer contains.

Example Code

Sample at 1kHz from pin 2 for four seconds. After four seconds, we stop sampling by calling **hardware.sampler.stop()* in the function stopSampler().