Código AI/AO

391 views
331 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
391
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Código AI/AO

  1. 1. Código AI/AO/* encender LED al apretar boton*...*/int ledPin = 13; // led a pin 13int botonPin =5; // boton input a pin 5int val= 0; void setup() { pinMode(ledPin, OUTPUT) ; pinMode(botonPin, INPUT) ;}void loop () { val = digitalRead(botonPin) ; if (val == HIGH) { digitalWrite(ledPin, LOW) ; } else { digitalWrite(ledPin, HIGH) ; delay(1000) ; digitalWrite(ledPin, LOW); delay(1000) ; } }  

×