<div>/* Sweep</div><div> by BARRAGAN <http://barraganstudio.com></div><div> This example code is in the public domain.</div><div><br></div><div> modified 8 Nov 2013</div><div> by Scott Fitzgerald</div><div> http://www.arduino.cc/en/Tutorial/Sweep</div><div>*/</div><div><br></div><div>#include <Servo.h></div><div><br></div><div>Servo myservo; // ¼º¸ Á¦¾î¸¦ À§ÇÑ °³Ã¼ »ý¼º</div><div>// twelve servo objects can be created on most boards</div><div><br></div><div>int pos = 0; // ¼º¸ À§Ä¡¸¦ ÁöÁ¤Çϱâ À§ÇÑ º¯¼ö</div><div><br></div><div>void setup() {</div><div> myservo.attach(97); // ¼º¸ °³Ã¼ÀÇ ÇÉ ¹øÈ£¸¦ ÁöÁ¤</div><div>}</div><div><br></div><div>void loop() {</div><div> for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees</div><div> // in steps of 1 degree</div><div> myservo.write(pos); // tell servo to go to position in variable 'pos'</div><div> delay(15); // waits 15ms for the servo to reach the position</div><div> }</div><div> for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees</div><div> myservo.write(pos); // tell servo to go to position in variable 'pos'</div><div> delay(15); // waits 15ms for the servo to reach the position</div><div> }</div><div>}</div>