超音波センサーのプログラムです。
Dependencies: mbed
main.cpp@1:8ebc0fbaa981, 2021-10-21 (annotated)
- Committer:
- ushiroji
- Date:
- Thu Oct 21 11:46:04 2021 +0000
- Revision:
- 1:8ebc0fbaa981
- Parent:
- 0:84736ef4c7d4
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ushiroji | 0:84736ef4c7d4 | 1 | #include "mbed.h" |
ushiroji | 0:84736ef4c7d4 | 2 | #include "us015.h" |
ushiroji | 1:8ebc0fbaa981 | 3 | #include "FrontGet.h" |
ushiroji | 0:84736ef4c7d4 | 4 | |
ushiroji | 0:84736ef4c7d4 | 5 | // 超音波センサ |
ushiroji | 0:84736ef4c7d4 | 6 | |
ushiroji | 0:84736ef4c7d4 | 7 | int main() { |
ushiroji | 1:8ebc0fbaa981 | 8 | int i; |
ushiroji | 1:8ebc0fbaa981 | 9 | while(1) { |
ushiroji | 1:8ebc0fbaa981 | 10 | if(i <= 10) { |
ushiroji | 1:8ebc0fbaa981 | 11 | FrontGet(); |
ushiroji | 1:8ebc0fbaa981 | 12 | wait(2); |
ushiroji | 1:8ebc0fbaa981 | 13 | i++; |
ushiroji | 1:8ebc0fbaa981 | 14 | } |
ushiroji | 1:8ebc0fbaa981 | 15 | else { |
ushiroji | 1:8ebc0fbaa981 | 16 | break; |
ushiroji | 1:8ebc0fbaa981 | 17 | } |
ushiroji | 0:84736ef4c7d4 | 18 | } |
ushiroji | 0:84736ef4c7d4 | 19 | } |