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.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I have an LPC1768 on a custom PCB. When I try to read the analog pin the code just locks up. Any idea why? I tried it as in int and a float. If I comment out the line with the analog stuff in it then it works fine.
#include "mbed.h" AnalogIn ain(p20); PwmOut led1(LED1); PwmOut led4(LED4); int main() { led1 = 1; while(1) { // float p= ain; unsigned short i = ain.read_u16(); led1 = 1; led4 = 0; wait(0.2); led1 = 0; led4 = 1; wait(0.2); } }