I've worked with the Servo library before, but for some reason I can't seem to get my servo to turn.
Here's the code:
Serial.println("Should be attaching...");
tempservo.attach(3);
Serial.print("Writing to: ");Serial.println(temppos);
tempservo.write(temppos);
delay(1000);
Serial.println("To position!");
tempservo.detach();
Any thoughts...It should be pretty straightforward. The Serial Monitor prints everything and temppos is a valid integer (in one case it was 59), so I can't see why it wouldn't work...
Post all of the code, please. Also, post a picture of your setup so we can verify the hardware portion. What you are trying to do is very simple, so you obviously have something fundamental wrong.
It isn't a hardware issue as the same servo attached the same way works fine with different code.
I cannot post some of the code because it has server information on it. Also "gauge" refers to an array of values that will be matched in the for loop.
Here is the majority of the loop code:
If I try to write the servo before this code then it works. If I write to the servo after it, it doesn't work. I can't figure out why this would be the case...any ideas? I thought I might be messing up my IF statement by changing the commacount, but I can't make logical sense of that. What am I missing?