KasperskyOS Community Edition 1.3

adc_hello example

This example demonstrates use of the Sensors driver in KasperskyOS.

In the example, the AdcHello program lets you check the functionality of ADC channels. The number of the channel used during the check is defined in the ADC_CHAN_NUM macro.

The program calculates the voltage supplied to the channel, normalizes it and prints it to standard output. The program also displays a list of ADC channels available for operation (SARADC_VIN6 and SARADC_VIN7 channels are in the output, but are not available for operation).

Example files

The code of the example and build scripts are available at the following path:

/opt/KasperskyOS-Community-Edition-<version>/examples/adc_hello

Building and running the example

This example is intended to run only on Radxa ROCK 3A.

For the example to work correctly, you must include a 1 V voltage source to the ADC pin according to the following schematic:

RPI_USB

See Building and running examples section.