Tutorial.Knob History

Hide minor edits - Show changes to markup

April 24, 2011, at 01:24 PM by Equipo Traduccion -
Changed lines 11-12 from:

Los servomotores tienes tres cables: alimentación, GND y señal. El cable de alimentación normalmente es rojo, y debe ser conectado al pin 5V de la placa Arduino. El cable de tierra debe ser conectado al pin de tierra de la placa Arduino. El pin de señal es típicamente amarillo o naranja y se conecta al pin 9 de la placa Arduino.

to:

Los servomotores tienes tres cables: alimentación, tierra y señal. El cable de alimentación normalmente es rojo, y debe ser conectado al pin 5V de la placa Arduino. El cable de tierra debe ser conectado al pin de tierra de la placa Arduino. El pin de señal es típicamente amarillo o naranja y se conecta al pin 9 de la placa Arduino.

April 24, 2011, at 01:24 PM by Equipo Traduccion -
Changed lines 11-12 from:

Los servomotores tienes tres cables: alimentación, tierra y señal. El cable de alimentación normalmente es rojo, y debe ser conectado al pin 5V de la placa Arduino. El cable de tierra debe ser conectado al pin de tierra de la placa Arduino. El pin de señal es típicamente amarillo o naranja y se conecta al pin 9 de la placa Arduino.

to:

Los servomotores tienes tres cables: alimentación, GND y señal. El cable de alimentación normalmente es rojo, y debe ser conectado al pin 5V de la placa Arduino. El cable de tierra debe ser conectado al pin de tierra de la placa Arduino. El pin de señal es típicamente amarillo o naranja y se conecta al pin 9 de la placa Arduino.

June 05, 2010, at 11:19 AM by Equipo Traduccion -
Changed lines 7-8 from:

Usa un potenciómetro para contral el movimiento de giro de un eje de un servomotor.

to:

Usa un potenciómetro para controlar el movimiento de giro de un eje de un servomotor.

June 04, 2010, at 11:35 PM by Equipo Traduccion -
Changed lines 3-4 from:

Knob

to:

Mando

June 04, 2010, at 11:26 PM by Equipo Traduccion -
Deleted lines 8-9:

Uses a potentiometer to control the movement of the shaft of a servo motor.

Deleted lines 10-11:

Servo motors have three wires: power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino board. The ground wire is typically black or brown and should be connected to a ground pin on the Arduino board. The signal pin is typically yellow or orange and should be connected to pin 9 on the Arduino board.

Changed lines 13-16 from:

The potentiometer should be wired so that its two outer pins are connected to power (+5V) and ground, and its middle pin is connected to analog input 0 on the Arduino.

Code

to:

El potenciómetro debe ser conectado de manera que los dos pines exteriores estén conectado a alimentación (+5V) y tierra, y su pin del medio conectado a la entrada analógica 0 en el Arduino.

Código

Changed lines 18-20 from:

// Controlling a servo position using a potentiometer (variable resistor) // by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

to:

// Controlando la posición de un servo usando un potenciómetro (resistencia variable) // Por Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

Changed line 23 from:

Servo myservo; // create servo object to control a servo

to:

Servo myservo; // Crea un objeto servo para controlar el servomotor

Changed lines 25-26 from:

int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin

to:

int potpin = 0; // Pin analógico usado para conectar el potenciómetro int val; // variable para leer el valor del pin analógico

Changed line 30 from:
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
to:
  myservo.attach(9);  // asocia el servo en pin 9 al objeto servo
Changed lines 35-38 from:
  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) 
  myservo.write(val);                  // sets the servo position according to the scaled value 
  delay(15);                           // waits for the servo to get there 
to:
  val = analogRead(potpin);            // lee el valor del potenciómetro (valor entre 0 y 1023) 
  val = map(val, 0, 1023, 0, 179);     // escala el valor para usarlo con el servo (valor entre 0 y 180) 
  myservo.write(val);                  // fija la posición del servo de acuerdo al valor escalado 
  delay(15);                           // espera a que el servo se posicione
Changed lines 42-43 from:

See also

to:

Ver también

June 04, 2010, at 11:17 PM by Equipo Traduccion -
Changed lines 1-2 from:

Examples > Servo Library

to:

Ejemplos > Librería Servos

Changed lines 5-6 from:

Description

to:

Descripción

Usa un potenciómetro para contral el movimiento de giro de un eje de un servomotor.

Changed lines 11-12 from:

Circuit

to:

Circuito

Added lines 15-16:

Los servomotores tienes tres cables: alimentación, tierra y señal. El cable de alimentación normalmente es rojo, y debe ser conectado al pin 5V de la placa Arduino. El cable de tierra debe ser conectado al pin de tierra de la placa Arduino. El pin de señal es típicamente amarillo o naranja y se conecta al pin 9 de la placa Arduino.

October 13, 2008, at 09:07 PM by David A. Mellis -
Changed lines 1-2 from:

Examples > Analog I/O

to:

Examples > Servo Library

Changed lines 5-16 from:

A potentiometer is a simple knob that provides a variable resistance, which we can read into the Arduino board as an analog value. In this example, that value controls the rate at which an LED blinks.

We connect three wires to the Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the potentiometer. The third goes from analog input 2 to the middle pin of the potentiometer.

By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, analogRead() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.

Circuit

Code

to:

Description

Uses a potentiometer to control the movement of the shaft of a servo motor.

Circuit

Servo motors have three wires: power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino board. The ground wire is typically black or brown and should be connected to a ground pin on the Arduino board. The signal pin is typically yellow or orange and should be connected to pin 9 on the Arduino board.

The potentiometer should be wired so that its two outer pins are connected to power (+5V) and ground, and its middle pin is connected to analog input 0 on the Arduino.

Code

Changed lines 18-47 from:

/* Analog Read to LED

 * ------------------ 
 *
 * turns on and off a light emitting diode(LED) connected to digital  
 * pin 13. The amount of time the LED will be on and off depends on
 * the value obtained by analogRead(). In the easiest case we connect
 * a potentiometer to analog pin 2.
 *
 * Created 1 December 2005
 * copyleft 2005 DojoDave <http://www.0j0.org>
 * http://arduino.berlios.de
 *
 */

int potPin = 2; // select the input pin for the potentiometer int ledPin = 13; // select the pin for the LED int val = 0; // variable to store the value coming from the sensor

void setup() {

  pinMode(ledPin, OUTPUT);  // declare the ledPin as an OUTPUT

}

void loop() {

  val = analogRead(potPin);    // read the value from the sensor
  digitalWrite(ledPin, HIGH);  // turn the ledPin on
  delay(val);                  // stop the program for some time
  digitalWrite(ledPin, LOW);   // turn the ledPin off
  delay(val);                  // stop the program for some time

} @]

to:

// Controlling a servo position using a potentiometer (variable resistor) // by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

  1. include <Servo.h>

Servo myservo; // create servo object to control a servo

int potpin = 0; // analog pin used to connect the potentiometer int val; // variable to read the value from the analog pin

void setup() {

  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 

}

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) 
  myservo.write(val);                  // sets the servo position according to the scaled value 
  delay(15);                           // waits for the servo to get there 

} @]

See also

February 03, 2007, at 03:03 PM by David A. Mellis -
Added lines 1-47:

Examples > Analog I/O

Knob

A potentiometer is a simple knob that provides a variable resistance, which we can read into the Arduino board as an analog value. In this example, that value controls the rate at which an LED blinks.

We connect three wires to the Arduino board. The first goes to ground from one of the outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the potentiometer. The third goes from analog input 2 to the middle pin of the potentiometer.

By turning the shaft of the potentiometer, we change the amount of resistence on either side of the wiper which is connected to the center pin of the potentiometer. This changes the relative "closeness" of that pin to 5 volts and ground, giving us a different analog input. When the shaft is turned all the way in one direction, there are 0 volts going to the pin, and we read 0. When the shaft is turned all the way in the other direction, there are 5 volts going to the pin and we read 1023. In between, analogRead() returns a number between 0 and 1023 that is proportional to the amount of voltage being applied to the pin.

Circuit

Code

/* Analog Read to LED
 * ------------------ 
 *
 * turns on and off a light emitting diode(LED) connected to digital  
 * pin 13. The amount of time the LED will be on and off depends on
 * the value obtained by analogRead(). In the easiest case we connect
 * a potentiometer to analog pin 2.
 *
 * Created 1 December 2005
 * copyleft 2005 DojoDave <http://www.0j0.org>
 * http://arduino.berlios.de
 *
 */

int potPin = 2;    // select the input pin for the potentiometer
int ledPin = 13;   // select the pin for the LED
int val = 0;       // variable to store the value coming from the sensor

void setup() {
  pinMode(ledPin, OUTPUT);  // declare the ledPin as an OUTPUT
}

void loop() {
  val = analogRead(potPin);    // read the value from the sensor
  digitalWrite(ledPin, HIGH);  // turn the ledPin on
  delay(val);                  // stop the program for some time
  digitalWrite(ledPin, LOW);   // turn the ledPin off
  delay(val);                  // stop the program for some time
}

Share