> For the complete documentation index, see [llms.txt](https://cavedu.gitbook.io/linkit-7697/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cavedu.gitbook.io/linkit-7697/linkit-7697-development-guide-for-arduino-ide/tutorial/grove-ultrasonic-ranger.md).

# Grove Ultrasonic Ranger

The Grove Ultrasonic Ranger is a non-contact distance measurement module which works at 42KHz. It's suitable for projects that require middle distance measurement. Detailed module information can be accessed in [the official WiKi page](http://wiki.seeed.cc/Grove-Ultrasonic_Ranger/).

You can see how to download and install the driver by referring to:

* [How to install driver](https://docs.labs.mediatek.com/resource/linkit7697-arduino/en/grove-starter-kit)
* [Driver repository](https://github.com/MediaTek-Labs/linkit-7697-peripheral-drivers-for-arduino)

After the installation is done, follow the steps below to use this component.

### Setup and Execution <a href="#groveultrasonicranger-setupandexecution" id="groveultrasonicranger-setupandexecution"></a>

1. Connect the module to the **D2** header on the LinkIt 7697 breakout board.
2. Select the **File / Examples / Grove\_Ultrasonic\_Ranger-master / UltrasonicDisplayOnTerm** menu.&#x20;
3. Modify **line 43** from 7 to **2**. This makes the board use D2 header to receive the data:

   ```
   #include "Ultrasonic.h" 
    
   Ultrasonic ultrasonic(2); 
   void setup() 
   { 
       Serial.begin(9600);
   ```
4. Click the **Upload** icon to compile and upload the sketch file to the board.&#x20;
5. Open the serial monitor (with baud rate **9,600**) and reset the board to execute the application. You should be able to see the output as below:

![](https://3972650740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY4gduUSLWOCI23CXUWej%2Fuploads%2Fe94j6J2O1YMzLQcdk2Fn%2Fultrasonic_ranger.png?alt=media\&token=3878c0ca-e766-4801-96bd-f792d638879c)
