This video presentation is the ninth installment of the Essentials of MQX RTOS Application Development training course. In this session, you will be introduced to the LWADC Driver, and will learn to configure and read ADC input.
This training was created by Embedded Access Inc., a Freescale sponsored training provider and proven partner.
|Session 9 Course Line||Lab Outline|
First, watch the video for Session 9: LWADC Driver.
Then, follow through with the interactive lab assignment below.
In our previous lab we used a light weight timer to set an event bit every 100 msec and whenever this event bit was set the Input Task would send a message to the Health Task with the reading from the potentiometer. The problem however was that we hadn't yet covered the ADC and so the potentiometer value sent was 0.Now that you know how to initialize an ADC device and it's input it's now time to update this part of our application to include the actual potentiometer value in the message that is sent by the Input Task.
The objective of this lab is to learn about the lwadc driver by adding code to read the potentiometer and send the value to the health task.This objective will be accomplished by:
New functions/ structures you will use:
LWADC_STRUCT, LWADC_VALUE, __lwadc_init(), _lwadc_init_input(), _lwadc_read(),_lwadc_set_attribute(),_lwadc_read_average()
Need more help? The full source code for this lab can be found in the 'Lab Source Code' folder here.