9 years, 9 months ago.

"/extras/mbed_5e5da4a5990b/LPC1768/ARM/LPC1768.sct"Error:L6235E:More than 1 section matches selector

I am writing the code as follows but not able to compile:-

  1. include "mbed.h"
  2. include "adc.h"
  3. define SAMPLE_RATE 150000

DigitalOut int_led(LED1); DigitalOut test_led(LED2);

ADC adc(SAMPLE_RATE, 1);

void main() { test_led=1; int_led=0;

while (1) { adc.setup(p15,1); wait(1); adc.select(p15); adc.start(); while(!adc.done(p15)); int_led=1; test_led=0; wait(1); } }

It is giving error mentioned in subject line. I have added "adc.h" library also.

Kindly let me know the solution.

Thanks Akshay

Question relating to:

1 Answer

9 years, 9 months ago.

Hi, what ADC library are you using? there's no adc.h file in the mbed sources..

This is mbed ADC API http://mbed.org/handbook/AnalogIn

Regards,
0xc0170

Thanks for the answer. Can you please brief me with the connection as I suppose I am not giving analog in correctly? I am just giving analog input to pin P16 and monitoring the LED status.

posted by Akshay Padegaonkar 15 Jul 2014

ADC adc(SAMPLE_RATE, 1);

Where did you get ADC from ? Can you poiint us to your example or library you are using??

posted by Martin Kojtal 15 Jul 2014

I found one ADC_test program in the search result on mbed website. I tried to modify the program and instead of printing the values in the program I was trying to toggle the LEDs. In that program I found one library named ADC_full in which I got adc.h

Now the problem is the code has ADC registers configured in it while the code that you sent me looked easy. But after dumping the code on the controller and giving analog input, LED isn't behaving as expected. I am not getting exactly how to use ADC of mbed LPC 1768 board.

I tried 2 codes, one that I posted as question which is giving me error during compiling and other that you gave which is getting compiled successfully but does not seem to behave as expected. Kindly help me out.

posted by Akshay Padegaonkar 15 Jul 2014

AnalogIn should work, the other library is non-generic, can't comment that one. Does not seem to behave as expected ?Waht does that mean? report problems more detailed.

posted by Martin Kojtal 15 Jul 2014