Hoy me llego el envio de Sparkfun con mi Pan/Tilt Bracket y unos Servos.
Con ellos me decidi a realizar algunas pruebas que mostrare a continuacion.
Elementos a utilizar:
DuinoBot v1.2 (RobotGroup ARG)
Pan/Tilt Bracket (Paneos)
Servos
Protoboards
Jumpers
Potenciometro
Tambien codifique con la IDE de Arduino para que estos elementos "se fusionaran" en mi TEST. ;-)
Codigo Parcial
void setup(){
servoTilt.attach(2); //The Tilt servo is attached to pin 2.
//servoPan.attach(3); //The Pan servo is attached to pin 3.
servoTilt.write(10); //Initially put the servos both
//servoPan.write(40); //at 90 degress.
Serial.begin(57600); //Set up a serial connection for 57600 bps.
}
void loop(){
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
servoTilt.write(val); // sets the servo position according to the scaled value
delay(20); // waits for the servo to get there
}
Codigo IDE Arduino PDE
Video Sobre el Escritorio
Mi idea a futuro sera conectar una camara web (Wi-Fi) y poder controlar los movimientos de la camara a traves de un Joystick mas un Arduino.
Video Con Anclaje
Elementos a utilizar:
DuinoBot v1.2 (RobotGroup ARG)
Pan/Tilt Bracket (Paneos)
Servos
Protoboards
Jumpers
Potenciometro
Tambien codifique con la IDE de Arduino para que estos elementos "se fusionaran" en mi TEST. ;-)
Codigo Parcial
void setup(){
servoTilt.attach(2); //The Tilt servo is attached to pin 2.
//servoPan.attach(3); //The Pan servo is attached to pin 3.
servoTilt.write(10); //Initially put the servos both
//servoPan.write(40); //at 90 degress.
Serial.begin(57600); //Set up a serial connection for 57600 bps.
}
void loop(){
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
servoTilt.write(val); // sets the servo position according to the scaled value
delay(20); // waits for the servo to get there
}
Codigo IDE Arduino PDE
Video Sobre el Escritorio
Mi idea a futuro sera conectar una camara web (Wi-Fi) y poder controlar los movimientos de la camara a traves de un Joystick mas un Arduino.
Video Con Anclaje
Comentarios