Created
December 3, 2025 21:30
-
-
Save lazypwny751/97e2d082143c49469c8a73f1400c85e8 to your computer and use it in GitHub Desktop.
Melodi Çalan Servo Motor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Servo.h> | |
| Servo myServo; | |
| // Basit melodi notaları (servo pozisyon değişimi ile) | |
| int melody[] = {30, 60, 90, 120}; // Servo açıları | |
| int noteDuration = 200; // Her nota 200 ms | |
| void setup() { | |
| myServo.attach(9); // Servo pinini bağla | |
| } | |
| void loop() { | |
| // Melodiyi sırayla çal | |
| for (int i = 0; i < 4; i++) { | |
| myServo.write(melody[i]); // Servo açı değişimi | |
| delay(noteDuration); // Notanın süresi | |
| } | |
| delay(500); // Melodiyi tekrar etmeden önce kısa bekleme | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment