From Wiring

Jump to: navigation, search
This page is intended as a reference for core developers only, and the content is only changed after a consensus has been reached through discussion of any such changes. Please use the Discussion page to talk about any changes or issues you have with the current implementation.
Classification Analog to Digital Pin Function
Suggested location WAnalog.h
C++ required No
Timing constraints None
Version introduced 1.0 (0100)
Framework dependencies None
int16_t analogRead(uint8_t pin)
Required? Yes
Issues None



The analogRead() function/method returns the analog reading at the provided pin number.

Black Box Input

The pin number is provided.

Black Box Output

If possible, the analog reading, using the controller's A2D hardware functionality, at the input pin is read and returned. The return value is a signed 16 bit integer. If there is no A2D available on the controller, or at the specified pin, then 0 (zero) is returned.


None. Single signature only.


Proposed Changes

For Wiring 1.1

According to Issue 9, pinRead() will be defined as:

int16_t pinRead(pin_t pin);

See Issue 9 for more details.

Personal tools