I created a program using one A/D (i know my question above states 2) and based on whether the A/D value is < 0x7fff (turn Red led on) and if the A/D value is >0x7fff (turn Yellow led on).
Now that I'm using two A/D's, I see a pointer is being used for each stored A/D value.
I'm not sure how to read "value" and "value". I will use two leds for "value" result, and another two for "value" result. The Red and Yellow criteria will be the same as above.
I commented out my LED-Code so I can step-through the program and observe what happens during the A/D process.
Here's what I observed:
When I hovered over 'word' (in red) the 'value' was 0x0000 which is correct, since I adjusted pot1 so the input pin will read 0 volts.
Likewise, when I hovered over 'word' (in blue) the 'value' was approximately 0xffff which is correct, since I adjusted pot2 so the input pin will read 3.3 volts.
This confirmed to me, that the program I created using two A/D's is working correctly.
Here's my struggle:
I'm not clear how to use the result from "value", then light the led that determines if it's less than or greater than 0x7fff. Similarly, the same holds true how to read "value".
Below is my code for a successful measurement with two A/D channels. You'll notice I have the LED-code commented out that was related to my single channel led test. Of course, the uncommented code does not reflect the single channel A/D I used previously.
Note: I overlapped (void)AD1_GetValue16(&value) in the screen capture for clarity to the reader.
Also, you will notice, below, in the commented code, how I determined whether the Red or Yellow led should turn on/off based on the A/D measurement. This code did work for the signal A/D measurements.