acomp_basic

Overview

The ACOMP Basic Example shows the simplest way to use ACOMP driver and help user with a quick start.

In this example, user should indicate an input channel to capture a voltage signal (can be controlled by user) as the ACOMP’s negative channel input. On the postive side, the internal voltage ladder is used to generate the fixed voltage about half value of reference voltage.

When running the project, change the input voltage of user-defined channel, then the comparator’s output would change between logic one and zero when the user’s voltage crosses the internal ladder’s output. The endless loop in main() function would detect the logic value of comparator’s output, and change the LED. The LED would be turned on when the compare output is logic one, or turned off when zero.

Supported Boards