Psoc 4 ADC and PSoC Creator 4.2
Update: I looked up the problem for receiving optimized_out for values and it was because the compiler was optimized and seemed to change something with the variables when debugging. I turned off the compiler optimization and the ADC works now also I took out the second line of code above since it is called in the third line. I do plan on turning on the compiler optimization back on when I am done debugging though.