Difference between revisions of "Arduino 12 - servo s knižnicou"

From DT^2
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="C++"> #include <Servo.h> Servo motor; void setup() { motor.attach(2); } void loop() { motor.write(90); delay(2000); motor.write(180); delay(2...")
 
(No difference)

Latest revision as of 07:04, 31 July 2019

#include <Servo.h>
Servo motor;

void setup() {
  motor.attach(2);
}
void loop() {
  motor.write(90);
  delay(2000);
  motor.write(180);
  delay(2000);
  motor.write(0);
  delay(2000);
}