FRDM-K64 ADC basic example using mbed

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FRDM-K64 ADC basic example using mbed

FRDM-K64 ADC basic example using mbed

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.

Code:

#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)

    {

    x=AnIn.read();

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

    wait(.2);

    }

}

添付
評価なし
バージョン履歴
最終更新日:
‎06-27-2014 11:13 AM
更新者: