Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

arduino servo motor controll

#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);                     
  } 
}
Source by mechatrofice.com #
 
PREVIOUS NEXT
Tagged: #arduino #servo #motor #controll
ADD COMMENT
Topic
Name
7+6 =