Servo এদিক-ওদিক ঘোরানোServo Motor Arduino Code & Circuit (SG90)
Servo library কোণ পাঠায়; SG90 ০° থেকে ১৮০° পর্যন্ত যায় আবার ফিরে আসে। Step বা delay বদলে দেখো কেমন নড়ে।
The Servo library sends the angle; the SG90 sweeps from 0° to 180° and back. Change the step or delay and watch the horn move.
যা যা লাগবে · Parts you need
- 1 × Arduino Uno Arduino Uno
- 1 × Servo motor (SG90) সার্ভো মোটর (SG90)
- 3 × Jumper wires জাম্পার তার
তার লাগানো · Wiring
| Servo motor (SG90) VCC | → | Arduino Uno 5V |
| Servo motor (SG90) GND | → | Arduino Uno GND |
| Servo motor (SG90) SIG | → | Arduino Uno D9 |
Code (Arduino C++)
#include <Servo.h>
Servo myServo;
void setup() {
myServo.attach(9);
}
void loop() {
for (int a = 0; a <= 180; a += 5) { myServo.write(a); delay(30); }
for (int a = 180; a >= 0; a -= 5) { myServo.write(a); delay(30); }
}
ভিডিও · Videos
Servo motor sg90 full bangla tutorial with coding (বাংলা)
Arduino tutorial 7- How to control Servo motor with Arduino (code explained) | using serv…