Sera / Test_potentiometer

Dependents:   Kaiduka_20210318

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に表示(確認用)


    }
}