Guest User

lab0

a guest
Aug 11th, 2016
1,881
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. //lab 0
  2. //autor: walter caicedo
  3. //unidad 1
  4. # define LED 4
  5. # define POT A3
  6. // metodo que hace prender el LED
  7.  
  8. void setup() {
  9.   // put your setup code here, to run once:
  10. pinMode (LED, OUTPUT);
  11. pinMode (POT, INPUT);
  12. }
  13.  
  14. void loop() {
  15.   // put your main code here, to run repeatedly:
  16. int valor = analogRead (POT);
  17. digitalWrite(LED, HIGH);
  18. delay (valor);
  19. digitalWrite(LED, LOW);
  20. delay(valor);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment