Hobby servos are a type of self-contained motor that can move in a 180º arc. All that is needed is a pulse sent every 20ms. This example uses a servoPulse function to move the servo from 10º -170º and back again.
int servoPin = 2; // servo connected to digital pin 2
int myAngle; // angle of the servo roughly 0-180
int pulseWidth; // servoPulse function variable
void setup()
{
pinMode(servoPin, OUTPUT); // sets pin 2 as output
}
void servoPulse(int servoPin, int myAngle)
{
pulseWidth = (myAngle * 10) + 600; // determines delay
digitalWrite(servoPin, HIGH); // set servo high
delayMicroseconds(pulseWidth); // microsecond pause
digitalWrite(servoPin, LOW); // set servo low
}
void loop()
{
// servo starts at 10 deg and rotates to 170 deg
for (myAngle=10; myAngle<=170; myAngle++)
{
servoPulse(servoPin, myAngle); // send pin and angle
delay(20); // refresh cycle
}
// servo starts at 170 deg and rotates to 10 deg
for (myAngle=170; myAngle>=10; myAngle--)
{
servoPulse(servoPin, myAngle); // send pin and angle
delay(20); // refresh cycle
}
}
NEURAL NETWORKS FOR 3D MOTION DETECTION FROM A SEQUENCE OF IMAGE FRAMES
-
NEURAL NETWORKS FOR 3D MOTION DETECTION FROM A SEQUENCE OF IMAGE FRAMES
In video surveillance, video signals from multiple remote locations are
displayed...