YARPF

Raspberry Pi Logo YetAnotherRaspberryPiFanpage

4.1 - Un Potentiometro y una LED

Plan

wiring plan

Board

bread board

Code

int pinPot = 2;
int pinLED = 13;
int val = 0;

void setup() {
  pinMode(pinLED, OUTPUT);
}

void loop() {
  val = analogRead(pinPot);
  digitalWrite(pinLED, HIGH);
  delay(val);
  digitalWrite(pinLED, LOW);
  delay(val);
}

Download

Fritzing: poti_led.fzz

Comments ?

blog comments powered by Disqus