d5a8c7ae29
***NO_CI*** |
||
---|---|---|
.github/workflows | ||
System.Device.Adc | ||
assets | ||
config | ||
.github_changelog_generator | ||
.gitignore | ||
CHANGELOG.md | ||
LICENSE.md | ||
NuGet.Config | ||
README.md | ||
azure-pipelines.yml | ||
nanoframework.System.Device.Adc.nuspec | ||
nanoframework.System.Device.Adc.sln | ||
template.vssettings | ||
version.json |
README.md
Welcome to the .NET nanoFramework System.Device.Adc Library repository
Build status
Component | Build Status | NuGet Package |
---|---|---|
System.Device.Adc |
Usage
Each target device has an ADC Controller, no matter how many ADC hardware blocks the microcontroller has. To read a channel, one must first instantiate the ADC controller and open the channel from which it's intended to read from. In order to read the raw value from an ADC channel, it's a simple matter of calling the Read() method on a open channel.
AdcController adc1 = new AdcController();
AdcChannel channel0 = adc1.OpenChannel(0);
int myAdcRawvalue = channel0.ReadValue();
To find details about the ADC controller, one can query the various properties of the ADC controller, like this.
// get maximum raw value from the ADC controller
int max1 = adc1.MaxValue;
// get minimum raw value from the ADC controller
int min1 = adc1.MinValue;
// find how many channels are available
int channelCount = adc1.ChannelCount;
// resolution provided by the ADC controller
int adcResolution = adc1.ResolutionInBits;
Feedback and documentation
For documentation, providing feedback, issues and finding out how to contribute please refer to the Home repo.
Join our Discord community here.
Credits
The list of contributors to this project can be found at CONTRIBUTORS.
License
The nanoFramework Class Libraries are licensed under the MIT license.
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community. For more information see the .NET Foundation Code of Conduct.
.NET Foundation
This project is supported by the .NET Foundation.