Skip to main content

How to use ADC library

danger

this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.


ADC library provides easy access to use ADC available on Toradex Computer Modules.

Use cases are:

  • Temperature sensor
  • Light sensor
  • and many more..

ADC Library

We provide free Library for ADC including sample source code.

ProjectModule compatibilityLanguageLibrary Version
ADCPXA / TegraCToradex CE Library (Old)
ADCVFxx / iMX6CToradex CE Library (New)
ADCPXA / TegraC#Toradex CE Library (Old)
ADCVFxx / iMX6C#Toradex CE Library (New)

Schematic

Demo application in C

This application demonstrates how to read analog inputs.

  • Follow this tutorial up to step 9 to create a new VC++ project. Edit the code as follows:
  • To include ADC library into project refer this article.
  • Build and deploy solution.
Output

Demo application in C#

  • Download ADC demo source code from above links.
  • Download and Install .NET Compact Framework on device from here.
  • Navigate to Solution Explorer in visual studio, Right Click on vcsharp_adc_demo > Properties > Devices.
  • Uncheck Deploy the Latest version of the .NET Compact Framework (including Service Packs).
  • Navigate to Solution Explorer in visual studio, Right Click on vcsharp_adc_demo > Properties > Build.
  • Check Allow unsafe code.
  • Build and Deploy solution.



Send Feedback!