SHARE
TWEET

Untitled

a guest Jan 27th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   // Importer la librairie servo
  2. #include <Servo.h>
  3.   // Créer la variable servom
  4. Servo Servom;
  5.  
  6. void setup() {
  7.   // put your setup code here, to run once:
  8.   // Attacher le servo à la broche (pin) D9
  9. Servom.attach(9);
  10. }
  11.  
  12. void loop() {
  13.   // put your main code here, to run repeatedly:
  14.   // Faire bouger le bras de 0° à 180° une seule fois.
  15.   for (int position = 0; position <= 180; position++){
  16.     Servom.write(position);
  17.     delay(10000);
  18.   }
  19.   // Faire bouger le bras dans le sens inverse
  20.   for (int position = 180; position >=0; position--){
  21.     Servom.write(position);
  22.     delay(1000);
  23.   }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top