[SOLVED] Servo Motor is not rotating write !!


i trying rotate servo pot, , i've noticed servo running 180  :smiley-eek-blue:
i 've tried servo, , result same.
i don know wrong ?!

here code:
code: [select]

#include <servo.h>
servo servo1;
int potpin = a0;
int anval;

void setup() {
 servo1.attach(3);
}

void loop() {
 anval = analogread(potpin);
 anval = map(anval, 50, 1017, 0, 180);
 servo1.write(anval);
 delay(15);
}


i've used serial monitor define values of voltage divider of pot.
i've try know wrong trying rotate 0 degree strait forward "servo1.write(0);", "servo1.write(180). , still, nothing happens !!
i have futaba s3003.

any ideas ?!

add debug line or 2 see val analogread...

code: [select]

#include <servo.h>
servo servo1;
int potpin = a0;
int anval;

void setup()
{
  serial.begin(9600);
  servo1.attach(3);
}

void loop() {
  anval = analogread(potpin);
  anval = map(anval, 50, 1017, 0, 180);
  servo1.write(anval);
  serial.println(anval);
  delay(15);
}


how did connect potmeter?
can post drawing?


Arduino Forum > Using Arduino > Programming Questions > [SOLVED] Servo Motor is not rotating write !!


arduino

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial