0

Hello. I'm having a bit of trouble with my programming. I'm giving a signal to my board and it will detect and display the maximum and minimum point of the signal wave.
However, I'm not really sure if I wrote my codes correctly.
Also, I'm getting this error :
"operator requires a pointer and an integer as operands"

Here's a part of my codes.

ADCON0 = ADC_SINE;
      ADCON0bits.GO = 1;
      while (ADCON0bits.DONE);             //Terminates the A/D conversion when all the signal are converted
      adc_result = 256*ADRESH + ADRESL;      // Store the result

      min=adc_result[0];
      max=adc_result[0];
      for(j=0;j<i;j++)
      {
         if(adc_result[j]<min)
         {
            min=adc_result[j];
         }
      }
      for(k=0;k<i;k++)
      {
         if(adc_result[k]<max)
         {
            max=adc_result[k];
         }
      }

      CurPosLCD(0x10);
      Out_LCD(ROM_TYPE "MIN= ");
      Out_Dec_LCD(min);
      CurPosLCD(0x20);
      Out_LCD(ROM_TYPE "MAX= ");
      Out_Dec_LCD(max);      
      Delay_sec(1);

I hope someone could help me out here.

Thank You.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by unexpert
0

oh no..i think i got the wrong section of the forum, it supposed to be posted on C and not C++
silly me

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.