From 5194137afe37af8f232b1b1befdf105189c0ea6f Mon Sep 17 00:00:00 2001 From: ft-NotArt Date: Wed, 5 Mar 2025 01:55:36 +0100 Subject: [PATCH] ~ | Some more tests --- Servo_test/Servo_test.ino | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Servo_test/Servo_test.ino b/Servo_test/Servo_test.ino index 14be037..71d6e11 100644 --- a/Servo_test/Servo_test.ino +++ b/Servo_test/Servo_test.ino @@ -4,12 +4,23 @@ Servo servo1 ; Servo servo2 ; void setup() { - servo1.attach(9); // attache le servo1 au pin 9 - servo2.attach(10); // attache le servo2 au pin 10 + servo1.attach(9) ; // attache le servo1 au pin 9 + servo2.attach(10) ; // attache le servo2 au pin 10 + + servo1.write(0) ; + servo2.write(0) ; + delay(1000) ; + } void loop() { - - servo1.write(0) ; - servo2.write(0) ; + static int a = 0 ; + a += 5 ; + servo1.write(a) ; + servo2.write(a) ; + delay(100) ; + if (a == 0) + delay(1000) ; + else if (a == 180) + a = -5 ; } \ No newline at end of file