Coding for Servo

 //subscribe the chnnel Fun_With_Engineering

#include <Servo.h>

Servo myservo;

int pos = 0;

void setup() {

  myservo.attach(9);

}

void loop() {

  for (pos = 0; pos <= 180; pos += 1) { 

    myservo.write(pos);              

    delay(15);                   

  }

  for (pos = 180; pos >= 0; pos -= 1) { 

    myservo.write(pos);              

    delay(15);                       

  }

}



Comments

Popular posts from this blog

How to make a LED flasher by using Transistor BC547 in Multisim || High-quality flasher

Design a boost convertor(dc to dc) input 3.5 to 12 volt and output 24 to 62 volt on multisim