玉田機体サンプルプログラムとは違うピン配置となっている。
Dependencies: mbed
main.cpp@0:af6ad713f332, 2019-07-30 (annotated)
- Committer:
- GGU
- Date:
- Tue Jul 30 04:10:42 2019 +0000
- Revision:
- 0:af6ad713f332
- Child:
- 1:419e4a7b47d0
test;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GGU | 0:af6ad713f332 | 1 | //シリアル通信を利用してad_dataの数値を表記する |
GGU | 0:af6ad713f332 | 2 | #include "mbed.h" |
GGU | 0:af6ad713f332 | 3 | AnalogIn ain(A0); |
GGU | 0:af6ad713f332 | 4 | Serial pc(USBTX,USBRX); //tx,rx |
GGU | 0:af6ad713f332 | 5 | |
GGU | 0:af6ad713f332 | 6 | int main() { |
GGU | 0:af6ad713f332 | 7 | int ad_data; |
GGU | 0:af6ad713f332 | 8 | while(1) { |
GGU | 0:af6ad713f332 | 9 | ad_data=ain; |
GGU | 0:af6ad713f332 | 10 | pc.printf("%d\n",ad_data); |
GGU | 0:af6ad713f332 | 11 | } |
GGU | 0:af6ad713f332 | 12 | } |