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.

im sorry to ask this but, what kind of c++ ode is this? just curious

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.