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.
Diff: test_potentiometer.cpp
- Revision:
- 0:040a825abcfa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test_potentiometer.cpp Fri Apr 30 05:19:04 2021 +0000
@@ -0,0 +1,21 @@
+
+#include "mbed.h"
+
+AnalogIn potensio1(PA_0); // A0 Potentiometer 1
+
+float outValue;
+
+Serial pc(USBTX, USBRX); // tx, rx tera terminal等を使用してPCにA0ピンのセンサアナログ値を表示させる
+
+void motorReverse(void);
+
+int main() {
+
+ while(1) {
+ double pot = potensio1.read(); //0-1(0V~3.3V)
+ outValue = pot;
+ pc.printf("%f, %f\r\n", pot, outValue); //PCに表示(確認用)
+
+
+ }
+}