Skip to content

Instantly share code, notes, and snippets.

@victoroliv2
Created November 9, 2015 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victoroliv2/200ebf57144bd13e3cfd to your computer and use it in GitHub Desktop.
Save victoroliv2/200ebf57144bd13e3cfd to your computer and use it in GitHub Desktop.
#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