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.
test_potentiometer.cpp
- Committer:
 - Y_OKA
 - Date:
 - 2021-04-30
 - Revision:
 - 0:040a825abcfa
 
File content as of revision 0:040a825abcfa:
#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に表示(確認用)
    }
}