Arduino 12 - servo s knižnicou

From DT^2
Revision as of 07:04, 31 July 2019 by Palo (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#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);
}