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);
  }
}


Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

azrael2

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

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview