Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 3 months ago.
How to fix "error 20" identifier p20 is undefined?
- include "mbed.h" AnalogIn input(p20); Battery Divider DigitalOut led1(LED1);
int main() { while (1){ if(input > 1.0) { led1 = 1; wait(0.2); led1 = 0; wait(0.2); printf("(%1f)" , input.read()); } } } Here's is my program but still having error.
Hi, first try to use
<<code>> <</code>>
to render c/c++ code. It is much more readable:Weird, this program compiles fine for me (lpc1768 / lpc11u24).
Sam
posted by Samuel Mokrani 07 Feb 2013Hi Sam. Thanks for your answer. But I'm still facing the same problem.
posted by NYP ME 07 Feb 2013Do you have the same problem if you start a new program and copy/paste the code above ? Just to be sure that you are using the latest version of the mbed libraries.
posted by Samuel Mokrani 07 Feb 2013Yes, I copied and pasted your code above and in my earlier program folder I have been using with same libraries for other AnalogueIn pins but it worked.
posted by NYP ME 07 Feb 2013Which version of the mbed libraries are you using? Can you post your program ?
posted by Samuel Mokrani 07 Feb 2013Hi Sam, Thanks for your effort. Since you told me to update the libraries of mbed, i didn't check properly. The library I was using was 2012 library. Now i updated the library and solved. Thank you. :)
posted by NYP ME 07 Feb 2013