アナログ入力をPCで表示するプログラムです。

Dependencies:   mbed

Committer:
jksoft
Date:
Fri Mar 06 16:40:11 2015 +0000
Revision:
0:7aaa2aa0ce71
Child:
1:92135ec2c2df
???????PC??????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:7aaa2aa0ce71 1 #include "mbed.h"
jksoft 0:7aaa2aa0ce71 2
jksoft 0:7aaa2aa0ce71 3 AnalogIn sensor(P20);
jksoft 0:7aaa2aa0ce71 4
jksoft 0:7aaa2aa0ce71 5 int main() {
jksoft 0:7aaa2aa0ce71 6 while(1) {
jksoft 0:7aaa2aa0ce71 7 float tmp = sensor;
jksoft 0:7aaa2aa0ce71 8
jksoft 0:7aaa2aa0ce71 9 printf("tmp:%f\r\n",tmp);
jksoft 0:7aaa2aa0ce71 10
jksoft 0:7aaa2aa0ce71 11 wait(1.0);
jksoft 0:7aaa2aa0ce71 12 }
jksoft 0:7aaa2aa0ce71 13 }