Cintillo Institucional
Diferencias entre las revisiones 10 y 11
Versión 10 con fecha 2009-04-24 12:11:34
Tamaño: 2063
Comentario:
Versión 11 con fecha 2009-04-24 12:11:53
Tamaño: 1928
Comentario:
Los textos eliminados se marcan así. Los textos añadidos se marcan así.
Línea 13: Línea 13:
---- /!\ '''Edit conflict - other version:''' ----
Línea 16: Línea 16:
---- /!\ '''Edit conflict - your version:''' ----
Línea 20: Línea 20:
---- /!\ '''End of edit conflict''' ----
Línea 24: Línea 24:

wiki comunidad

Proyecto Hardware Libre Cenditel

Página Cenditel

wiki Cenditel

Plataforma de Desarrollo Colaborativo

Curso Sensibilización Hardware Libre (Unidad 002)

logohl.png logohl.png logohl.png

002/02 Actividad 002

// AnalogInput_

// AnalogInput_
// Carlos

// by DojoDave <http://www.0j0.org><<BR>> // http://www.arduino.cc/en/Tutorial/AnalogInput<<BR>> //

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

}



A este

hlpd/curso_arduino/uni00202 (última edición 2011-07-15 16:43:51 efectuada por _desactivada_csoto)