1928
Comentario:
|
1877
|
Los textos eliminados se marcan así. | Los textos añadidos se marcan así. |
Línea 14: | Línea 14: |
// AnalogInput_<<BR>> // AnalogInput_<<BR>> // Carlos // by DojoDave <http://www.0j0.org><<BR>> // http://www.arduino.cc/en/Tutorial/AnalogInput<<BR>> // <<BR>> |
. ''/ * Blink<<BR>> * [[http://www.arduino.cc/en/Tutorial/Blink<<BR>>|http://www.arduino.cc/en/Tutorial/Blink]] <<BR>>'' |
Curso Sensibilización Hardware Libre (Unidad 002)
Tabla de Contenidos
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