Pages: [1]   Go Down
Author Topic: Control 2 Servos with a photoresistor (Arduino UNO)  (Read 1559 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-grin @ oanadu@uco.edu. thanks a lot in advance
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9634
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
//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);
  }
}


Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 2
chilean ocupational therapist with strong interest in device creation to disabilities people
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: