Practical No 10 IOT
Practical No 10 IOT
Aim:- Develop an IoT based application using Arduino board to control servo
motors back and forth across 180 degrees.
Circuit diagram:-
Component:-
1. Arduino Board (e.g., Arduino Uno)
2. Servo Motor
3. Jumper Wires
4. Power Supply (for servo)
5. Breadboard
Code:-
#include <Servo.h> // Include the Servo library
void loop() {
// Move servo from 0 to 180 degrees
for (int pos = 0; pos <= 180; pos++) {
myServo.write(pos);
Serial.print("Servo Position: ");
Serial.println(pos);
delay(1); // Small delay for smooth movement
}