An analog input, used for reading the voltage on a pin. More...
#include <AnalogIn.h>
Public Member Functions | |
| AnalogIn (const PinMap &pinmap) | |
| Create an AnalogIn, connected to the specified pin. More... | |
| AnalogIn (PinName pin) | |
| Create an AnalogIn, connected to the specified pin. More... | |
| float | read () |
| Read the input voltage, represented as a float in the range [0.0, 1.0]. More... | |
| unsigned short | read_u16 () |
| Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF]. More... | |
| operator float () | |
| An operator shorthand for read() More... | |
An analog input, used for reading the voltage on a pin.
Example:
Definition at line 66 of file AnalogIn.h.
Create an AnalogIn, connected to the specified pin.
| pinmap | reference to structure which holds static pinmap. |
| AnalogIn | ( | PinName | pin | ) |
| operator float | ( | ) |
An operator shorthand for read()
The float() operator can be used as a shorthand for read() to simplify common code sequences
Example:
Definition at line 109 of file AnalogIn.h.
| float read | ( | ) |
Read the input voltage, represented as a float in the range [0.0, 1.0].
| unsigned short read_u16 | ( | ) |
Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF].