Created
November 9, 2015 07:47
-
-
Save victoroliv2/200ebf57144bd13e3cfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
#define MAX_SIGNAL 2000 | |
#define MIN_SIGNAL 700 | |
#define MOTOR_PIN 9 | |
Servo motor; | |
unsigned long time; | |
void setup() { | |
motor.attach(MOTOR_PIN); | |
time = millis(); | |
while (millis() - time < 3000) { | |
motor.write(179); | |
} | |
time = millis(); | |
while (millis() - time < 3000) { | |
motor.write(25); | |
} | |
//while (millis() - time < 3000) { | |
// motor.write(90); | |
//} | |
} | |
//static int power = 40; // minimum | |
//static int power = 90; // + | |
//static int power = 150; // + | |
static int power = 179; // + | |
//static int power = 180; // does not work | |
void loop() { | |
motor.write(power); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment