This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Analog inputs



Hello to everyone,

    I am using the LaunchPad LM4F120H5QR, and I am trying to control the blinking of one LED using a potensiometer... 

    I am asking for your help, because I don't know exactly which command should I use to make the PE3(for example) an analog input, and get data from the potensiometer...

    Any ideas?

Thank you in advance

  • Very hard to meaningfully succeed with even a simple task when the MCU is as complex as LX4F.  There is a wealth of literature - datasheets and numerous code examples will give you a much better foundation so that you can attack your objective. 

    We realize that the cost of this board was appealing - but the learning curve is not so discounted...  Many before have decided that ARM in general - especially Cortex M-4 - may not be the easiest - most efficient, "Starting Point."

    Suspect that 3 major areas of learning are your targets: GPIO, ADC and MCU Set-Up/Configuration.  You need some understanding/mastery of each - to achieve your objective.  My belief is that a serious read of the MCU datasheet (yes - it is some 1400+ pgs.) - at least the GPIO, ADC and System Control chapters will give you far greater understanding.  After that - look for code examples which deal with GPIO, ADC and System Control.  (most all examples will detail how the System Clock is configured - you must be sure to "match" the value of the xtal on your board to the mating parameter w/in the System Control Clock configuration.

    The ADC is likely the most complex of your 3 objectives.  Suggest that you "hold-off" with that - begin with System Control and GPIO - so that you can - at minimum - control your Led.  After that - you can "do battle" w/the ADC.

  • Hi Aggelos,

    If you download the software for the EK-LM4F232 board, the qs-logger examples shows how to configure and use the ADC on the LM4F products.  The example is pretty complex, but the AcquireInit function in the acquire.c file should get you started.

    Regards,

    Sue