This lab demonstrates the process of reading a potentiometer sensor value through an Analog-to-Digital Converter (ADC) using a Hardware Abstraction Layer (HAL) on a PSoC 6 microcontroller.
Coding: Open the main.c file and add the following code to the main(void) function.
Build the Application
Build Application
Launching the Application
Launching
Note: Before launching the program to the board, make sure that you have already connected the board to the computer through a USB cable.
set up USB cable
Result
Once the device is set up, run the program. The microcontroller will continuously read the potentiometer's analog value, convert it to a digital signal through the ADC, and then convert that signal to millivolts using the PDL functions.
🎉 Congratulations! You can now complete Lab105
Supported toolchains (make variable 'TOOLCHAIN')
GNU Arm® embedded compiler v10.3.1 (GCC_ARM) - Default value of TOOLCHAIN