Table of Contents
Example Description
The example demonstrates how to use an ultrasonic sensor with Quarky.

Connections

Now we will connect the Ultrasonic Sensor to the Robot. The sensor and the robot have the following pins:

  1. Ultrasonic Sensor Pins:
    1.  VCC
    2. GND
    3. Trig
    4. Echo
  2. Quarky Pins:
    1. GND
    2. V
    3. D1
    4. D2

We will start with connecting the ultrasonic sensor with Quarky using the 4 set wire provided in the kit. But, first, make the connection in the following way:

  • First, connect the VCC of the ultrasonic sensor with the V pin on the Quarky.
  • Connect the GND of the ultrasonic sensor with the Ground pin on the Quarky.
  • Connect Trig of the ultrasonic sensor with D1 pin on the Quarky.
  • Finally, connect the Echo of the ultrasonic sensor with the D2 pin on the Quarky.

Script

Output