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

Dependencies:   mbed

Committer:
GGU
Date:
Mon Jul 29 06:28:39 2019 +0000
Revision:
0:76eb7afb3f57
photo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GGU 0:76eb7afb3f57 1 #include "mbed.h"
GGU 0:76eb7afb3f57 2
GGU 0:76eb7afb3f57 3 AnalogIn photo(A4);
GGU 0:76eb7afb3f57 4 Serial pc(USBTX,USBRX);
GGU 0:76eb7afb3f57 5
GGU 0:76eb7afb3f57 6
GGU 0:76eb7afb3f57 7
GGU 0:76eb7afb3f57 8 int main(){
GGU 0:76eb7afb3f57 9 while(1){
GGU 0:76eb7afb3f57 10 pc.printf("%f\t",photo.read()); //センサから得たデータを出力
GGU 0:76eb7afb3f57 11 wait(1); //1sec
GGU 0:76eb7afb3f57 12 }
GGU 0:76eb7afb3f57 13 }
GGU 0:76eb7afb3f57 14