https://github.com/nanoframework/system.device.adc
:package: System.Device.Adc library for .NET nanoFramework
https://github.com/nanoframework/system.device.adc
adc dotnet embedded-systems esp32 hacktoberfest iot library nanoframework nxp stm32
Last synced: 9 days ago
JSON representation
:package: System.Device.Adc library for .NET nanoFramework
- Host: GitHub
- URL: https://github.com/nanoframework/system.device.adc
- Owner: nanoframework
- License: mit
- Created: 2021-10-27T13:16:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-02T10:27:30.000Z (3 months ago)
- Last Synced: 2025-06-29T06:36:32.032Z (17 days ago)
- Topics: adc, dotnet, embedded-systems, esp32, hacktoberfest, iot, library, nanoframework, nxp, stm32
- Language: C#
- Homepage: https://www.nanoframework.net
- Size: 85.9 KB
- Stars: 1
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://sonarcloud.io/dashboard?id=nanoframework_System.Device.Adc) [](https://sonarcloud.io/dashboard?id=nanoframework_System.Device.Adc) [](LICENSE) [](https://www.nuget.org/packages/nanoFramework.System.Device.Adc/) [](https://github.com/nanoframework/Home/blob/main/CONTRIBUTING.md) [](https://discord.gg/gCyBu8T)

-----
### Welcome to the .NET **nanoFramework** System.Device.Adc Library repository
## Build status
| Component | Build Status | NuGet Package |
|:-|---|---|
| System.Device.Adc | [](https://dev.azure.com/nanoframework/System.Device.Adc/_build/latest?definitionId=83&repoName=nanoframework%2FSystem.Device.Adc&branchName=main) | [](https://www.nuget.org/packages/nanoFramework.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.```csharp
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.
```csharp
// 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](https://github.com/nanoframework/Home).
Join our Discord community [here](https://discord.gg/gCyBu8T).
## Credits
The list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/main/CONTRIBUTORS.md).
## License
The **nanoFramework** Class Libraries are licensed under the [MIT license](LICENSE.md).
## 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](https://dotnetfoundation.org/code-of-conduct).## .NET Foundation
This project is supported by the [.NET Foundation](https://dotnetfoundation.org).