FRDM-K64 ADC basic example using mbed

Document created by Pedro Augusto Panecatl Salas Employee on Jun 27, 2014Last modified by ebiz_ws_prod on Dec 13, 2017
Version 5Show Document
  • View in full screen mode

Here you will find both the code and project files for the ADC project. This project configures the ADC to perform single conversions, by default this is performed using a 16 bit configuration. The code uses ADC0, channel 12, once the conversion is finished it is displayed at the serial terminal.




#include "mbed.h"


AnalogIn AnIn(A0);

DigitalOut led(LED1);


Serial pc(USBTX,USBRX);


float x;

int main()


    pc.printf(" ADC demo code\r\n");

    while (1)


    pc.printf("ADC0_Ch12=(%d)\r\n", x);




Original Attachment has been moved to:

Original Attachment has been moved to:

1 person found this helpful