Created
February 19, 2014 22:48
-
-
Save RuiSantosdotme/9103300 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Tutorial Arduino #1 - Piscar LED | |
Criado por Rui Santos | |
Tutorial Completo em: | |
http://randomnerdtutorials.com/pt | |
*/ | |
// Pino 13 esta conetado a um LED. (em quase todas as placas) | |
// vamos chamar "led" ao pino 13 | |
int led = 13; | |
// a rotina setup apenas acontece uma fez assim que fazemos reset à placa | |
void setup() { | |
// inicia o pino 13 digital como uma Saida | |
pinMode(led, OUTPUT); | |
} | |
// este loop e' uma rotina que vai ocorrer sempre | |
void loop() { | |
digitalWrite(led, HIGH); // liga o LED, fazendo com que a voltagem passe para HIGH | |
delay(1000); // espera 1 segundo | |
digitalWrite(led, LOW); // desliga o LED, fazendo com que a voltagem passe para LOW | |
delay(1000); // espera 1 segundo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment