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

Dependencies:   mbed

Files at this revision

API Documentation at this revision

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