Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
FrontGet.h@1:8ebc0fbaa981, 2021-10-21 (annotated)
- Committer:
- ushiroji
- Date:
- Thu Oct 21 11:46:04 2021 +0000
- Revision:
- 1:8ebc0fbaa981
test
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| ushiroji | 1:8ebc0fbaa981 | 1 | #include "us015.h" | 
| ushiroji | 1:8ebc0fbaa981 | 2 | |
| ushiroji | 1:8ebc0fbaa981 | 3 | US015 hs(D2, D3); | 
| ushiroji | 1:8ebc0fbaa981 | 4 | DigitalOut Ultra(D2); | 
| ushiroji | 1:8ebc0fbaa981 | 5 | Serial pc(USBTX,USBRX); | 
| ushiroji | 1:8ebc0fbaa981 | 6 | |
| ushiroji | 1:8ebc0fbaa981 | 7 | int FrontGet() { | 
| ushiroji | 1:8ebc0fbaa981 | 8 | Ultra = 1; //超音波on | 
| ushiroji | 1:8ebc0fbaa981 | 9 | hs.TrigerOut(); | 
| ushiroji | 1:8ebc0fbaa981 | 10 | wait(1); | 
| ushiroji | 1:8ebc0fbaa981 | 11 | int distance; | 
| ushiroji | 1:8ebc0fbaa981 | 12 | distance = hs.GetDistance(); | 
| ushiroji | 1:8ebc0fbaa981 | 13 | pc.printf("distance=%d\r\n", distance); //距離出力 | 
| ushiroji | 1:8ebc0fbaa981 | 14 | Ultra=0;//超音波off | 
| ushiroji | 1:8ebc0fbaa981 | 15 | return distance; | 
| ushiroji | 1:8ebc0fbaa981 | 16 | } |