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.
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); arduino sensor shield v5 0 manual
This manual will serve as your complete reference guide. We will cover the hardware overview, the pin-by-pin breakdown, power management, common troubleshooting issues, and a step-by-step example project. The Sensor Shield V5.0 is a passive expansion board designed specifically for the Arduino Uno R3 (as well as the Arduino Leonardo and similar form factors). It sits directly on top of your Arduino, stacking via the standard headers. Plug the USB cable into the Arduino
void setup() Serial.begin(9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); myservo.attach(10); // Servo is on pin 10 (SERVO1) void loop() // Sweep from 0 to 180