*

Dependencies:   mbed-STM32F103C8T6 mbed

main.cpp

Committer:
BaserK
Date:
2017-04-29
Revision:
0:7370c6a639a4

File content as of revision 0:7370c6a639a4:

#include "stm32f103c8t6.h"
#include "mbed.h"

// AnalogIn example
// Reads analog data from a pin and prints it to the com port

AnalogIn analog(PB_0);
Serial com(PA_2, PA_3);

float data = 0;

int main()
{
    confSysClock();     //Configure system clock (72MHz HSE clock, 48MHz USB clock)    
    com.baud(9600);
    
    while (1)
    {
        data = analog.read();
        com.printf("Analog data is: %.2f \r\n", data);
        wait(0.1);
    }    
}