Reading analog input with an STM32F103C8T6 board. ADC is calibrated to achieve higher accuracy.

Dependencies:   mbed

Reading analog input with STM32F103C8T6 board

Import the program into your online compiler.

Schematic

/media/uploads/hudakz/stm32f103c8t6_aanalogin.png

Revision:
2:b0563c2ef616
Parent:
1:7522adef9bd0
--- a/main.cpp	Tue Feb 05 13:04:43 2019 +0000
+++ b/main.cpp	Tue Feb 05 13:09:02 2019 +0000
@@ -4,7 +4,7 @@
 const float REF_VOLT = 3300; // Reference voltage in millivolts
 
 Serial      pc(PA_2, PA_3);
-DigitalOut  myled(LED1);
+DigitalOut  myled(PC_13);
 AnalogIn    analogIn(PA_0); // Create an analog input
 float       voltage;