#include <Servo.h> Servo myservo; const int trigPin = 8; const int echoPin = 9; int pos = 0;

void loop() // Sweep from 0 to 180 degrees for (pos = 0; pos <= 180; pos++) myservo.write(pos); delay(15); int distance = readUltrasonic(); Serial.print("Angle: "); Serial.print(pos); Serial.print(" cm: "); Serial.println(distance);

Enter the . This expansion board (or "shield") is designed to solve exactly this problem. It turns your messy breadboard into a clean, plug-and-play hub for sensors and servos.

Plug the USB cable into the Arduino. The "PWR" LED on the Arduino should light up. The "5V" LED on the Sensor Shield should also light up.