Hey, hopefully someone can give me a hand with this coding issue I have. I am trying to program the arduino so when the touch sensor is pressed, it will turn on a servo motor and make it turn 180 degrees. Right now it feels like the motor is fighting to move, but just won't go.
This is my code so far:
#include <Servo.h>
Servo motor1;
int touchPin = 6;
int servo = 8;
int value = 0;
int angle = 0;
Hi and welcome to the forum.
You need to read through the How to use this forum - please read sticky post located at the top of this and every forum here.
It covers many valuable items, including how to post code using the code tags.
Go read it.
Come back and edit your post.
If you are having difficulties with servos, I want to know how you are powering the servo?
Should be from a separate source, NOT the arduino 5v pin.
If the servo is small, and unloaded, you can some times get away with using the 5v. But it is much better to keep it separate. Make the grounds common.
Also if you are having problems, try the weep tutorial.
(and note that the sweep tutorial does not declare the servo pin an output and does not digitalWrite to the servo pin)
You apparently have a servo which is called motor1 on pin 8 and something else called servo which is also on pin8 and which for some reason you write HIGH and LOW to.