Class Mcp3201
MCP3002 Analog to Digital Converter (ADC)
Assembly: Mcp3xxx.dll
View Source
Declaration
public class Mcp3201 : Mcp3xxx, IAnalogInputController, IPinController, ISpiPeripheral, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.ICs.IOExpanders.Mcp3xxx
Implements:
Meadow.Hardware.IAnalogInputController
, Meadow.Hardware.IPinController
, Meadow.Hardware.ISpiPeripheral
, System.IDisposable
Properties
Pins
The pins
View Source
Declaration
public Mcp3201.PinDefinitions Pins { get; }
Methods
IsInputTypeSupported(InputType)
Is the input type supported on this MCP3xxx version
View Source
Declaration
public override bool IsInputTypeSupported(Mcp3xxx.InputType inputType)
Returns
System.Boolean
: True if supported, false if not supported
Parameters
Type | Name | Description |
---|---|---|
Meadow.Foundation.ICs.IOExpanders.Mcp3xxx.InputType | inputType | The input type |
CreateAnalogInputPort(int)
Create an analog input port for a pin
View Source
Declaration
public IAnalogInputPort CreateAnalogInputPort(int sampleCount = 64)
Returns
Meadow.Hardware.IAnalogInputPort
Parameters
Type | Name |
---|---|
System.Int32 | sampleCount |
CreateAnalogInputPort(int, TimeSpan, Voltage)
Create an analog input port for a pin
View Source
Declaration
public IAnalogInputPort CreateAnalogInputPort(int sampleCount, TimeSpan sampleInterval, Voltage voltageReference)
Returns
Meadow.Hardware.IAnalogInputPort
Parameters
Type | Name |
---|---|
System.Int32 | sampleCount |
System.TimeSpan | sampleInterval |
Meadow.Units.Voltage | voltageReference |
ReadInternal(int, InputType, int)
Reads a value from the device
View Source
Declaration
protected override int ReadInternal(int channel, Mcp3xxx.InputType inputType, int adcResolutionBits)
Returns
System.Int32
: A value corresponding to relative voltage level on specified device channel
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | channel | Channel to read - for differential inputs this represents a channel pair (valid values: 0 - channelcount - 1 or 0 - channelcount / 2 - 1 with differential inputs) |
Meadow.Foundation.ICs.IOExpanders.Mcp3xxx.InputType | inputType | The type of input channel to read |
System.Int32 | adcResolutionBits | The number of bits in the returned value |
Implements
Meadow.Hardware.IAnalogInputController
Meadow.Hardware.IPinController
Meadow.Hardware.ISpiPeripheral
System.IDisposable