SI
SI
discoversearch

Technology Stocks : The *NEW* Frank Coluccio Technology Forum

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
From: Mchristian8/26/2017 1:16:11 PM
  Read Replies (2) of 46074
 
Servo won't turn while accepting commands from an Arduino



Hello everyone,


In my first post, I'm asking for your advice -


I'm attempting to turn a servo with my Arduino when it gets orders from a serial contribution, for this situation, my console. I have officially done this with engines and it works fine however when I attempt with my servo it doesn't move by any means. (an example from - powerjackmotion.com ) So far I have this written -


#include <SoftwareServo.h>


SoftwareServo myservo;
int movemotor;
void setup() {
Serial.begin(9600);
myservo.attach (10);
myservo.write(90);
}
void loop() {
movemotor = Serial.read();
if (movemotor = 111) {
for (int pos = 90; pos >=0; pos--) {
myservo.write(pos);
delay(15);
}
}
else if (movemotor = 99) {
for (int pos = 90; pos <= 180; pos++) {
myservo.write(pos);
delay(15);
}
}
}


I'm powering the servo remotely with a 9-volt battery and have made a point to associate its ground to that of the Arduino, however, can't see whatever else I fouled up.
Any help would be greatly appreciated.
Thanks
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  

Copyright © 1995-2017 Knight Sac Media. All rights reserved.Stock quotes are delayed at least 15 minutes - See Terms of Use.