analogReadResolution(type)

analogReadResolution() is an extension of the Analog API for most LaunchPads.

Sets the size (in bits) of the value returned by analogRead(). It defaults to 10 bits (returns values between 0-1023).

Syntax

analogReadResolution(bits)

Parameters

bits: determines the resolution (in bits) of the value returned by analogRead() function. E.g. for MSP432 which has a 14 bit ADC you can set this to 14 bits with analogReadResolution(14).

 

Returns

None.

Reference Home