Can't control Modelcraft MC1811 micro servo


i'm working on project involves feeding input several servo engines via button inputs. today ran problem:

i've broken down code bare minimum servo @ didn't seem either. right have servo hooked arduino uno 1 simple button on breadboard. i'm trying servo engine move specific angle when pushing button , move idle angle when releasing button, doesn't work mc1811. attempted sg90 servo engine same code , worked.
now when load sweep example library (2 loops have go , forth betwee 0 , 180 degrees) works both servo engines. i've tested button on serial print , it's sending on/off signals.
any idea i'm doing wrong? might obvious; here's code

code: [select]
#include <servo.h>

int button = 8;
servo servo;

void setup() {
  serial.begin(9600);
  pinmode(button, input_pullup);
  servo.attach(3);
}

void loop() {
  if (digitalread(button)) {
    serial.println("on");
    servo.write(90);
  } else {
    serial.println("off");
    servo.write(0);
  }
  delay(500);
}

i'm not surprised nothing happens both of servo.write() statements tell go same place.

have tried servo sweep example comes arduino ide?

...r


Arduino Forum > Using Arduino > Project Guidance > Can't control Modelcraft MC1811 micro servo


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor