Go Down

Topic: Control 2 Servos with a photoresistor (Arduino UNO) (Read 1 time) previous topic - next topic

oltion_prifti

Hello there. this is my first post here in this forum and this is my first video that i have made. It demonstrate how to control 2 servos (and a LED too) with a photoresistor. The 2 servos are connected in serial with each other on digital pin # 10.

http://www.youtube.com/watch?v=Gj93E00tA90&fb_source=message

ShirleyYang0201

hello,just now I saw what have you done in the vedio. That's awesome! Recently I'm learning Embedded System,and the project that I want to do is exactly same like this. So I wondered that could you share the code with me pretty please;) I'm greatly appreciated. My e-mail is shirley2162008@hotmail.com

d-anadu

I've been trying to make my servo rotate for a while and stop, but it just keeps rotating either in the 180 direction or 0 direction. the video was exactly what i wanted. Pls can you send me the code :D @ oanadu@uco.edu. thanks a lot in advance

zoomkat

Button push servo code that probably be modified to be operated by a photoresistor.

Code: [Select]

//zoomkat servo button test 7-30-2011

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(160);
  }
  else {
    servo1.write(20);
  }
}


Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

azrael2

great work Im in a servo proyect and I searching another similar proyects to learn

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy