フォトセンサのサンプルプログラム
Dependencies: mbed
Revision 0:76eb7afb3f57, committed 2019-07-29
- Comitter:
- GGU
- Date:
- Mon Jul 29 06:28:39 2019 +0000
- Commit message:
- photo
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jul 29 06:28:39 2019 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" + +AnalogIn photo(A4); +Serial pc(USBTX,USBRX); + + + +int main(){ + while(1){ + pc.printf("%f\t",photo.read()); //センサから得たデータを出力 + wait(1); //1sec + } +} + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jul 29 06:28:39 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file