フォトセンサのサンプルプログラム

Dependencies:   mbed

main.cpp

Committer:
GGU
Date:
2019-07-29
Revision:
0:76eb7afb3f57

File content as of revision 0:76eb7afb3f57:

#include "mbed.h"

AnalogIn photo(A4);
Serial pc(USBTX,USBRX);



int main(){
    while(1){
        pc.printf("%f\t",photo.read()); //センサから得たデータを出力
        wait(1);    //1sec
    }
}