Cintillo Institucional
Diferencias entre las revisiones 16 y 17
Versión 16 con fecha 2009-04-24 12:23:23
Tamaño: 1905
Comentario:
Versión 17 con fecha 2009-04-24 12:23:58
Tamaño: 1958
Comentario:
Los textos eliminados se marcan así. Los textos añadidos se marcan así.
Línea 15: Línea 15:
 . ''int potPin = 2; // select the input pin for the potentiometer<<BR>>
 .
int ledPin = 13; // select the pin for the LED<<BR>> int val = 0; // variable to store the value coming from the sensor<<BR>> <<BR>> void setup() {<<BR>>
 .
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT<<BR>>
 .
}<<BR>> <<BR>>
   .
void loop() {<<BR>>
 .
val = analogRead(potPin); // read the value from the sensor<<BR>>
 .
digitalWrite(ledPin, HIGH); // turn the ledPin on<<BR>>
 .
delay(val); // stop the program for some time<<BR>>
 .
digitalWrite(ledPin, LOW); // turn the ledPin off<<BR>>
 .
delay(val); // stop the program for some time<<BR>>
 .
}<<BR>>
 . ''int potPin = 2; // select the input pin for the potentiometer<<BR>> ''
 . ''
int ledPin = 13; // select the pin for the LED<<BR>> int val = 0; // variable to store the value coming from the sensor<<BR>> <<BR>> void setup() {<<BR>> ''
 . ''
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT<<BR>> ''
 . ''
}<<BR>> <<BR>>  ''

 . ''
void loop() {<<BR>> ''
 . ''
val = analogRead(potPin); // read the value from the sensor<<BR>>  ''
 . ''
digitalWrite(ledPin, HIGH); // turn the ledPin on<<BR>>  ''
 . ''
delay(val); // stop the program for some time<<BR>>  ''
 . ''
digitalWrite(ledPin, LOW); // turn the ledPin off<<BR>>  ''
 . ''
delay(val); // stop the program for some time<<BR>> ''
 . ''
}<<BR>> ''
Línea 30: Línea 30:
A este A este 

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

  • / * Blink
    * http://www.arduino.cc/en/Tutorial/Blink

  • */

  • 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)