Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-STM32F103C8T6 mbed
Diff: main.cpp
- Revision:
- 0:7370c6a639a4
diff -r 000000000000 -r 7370c6a639a4 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Apr 29 15:29:18 2017 +0000
@@ -0,0 +1,23 @@
+#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);
+ }
+}
\ No newline at end of file