Created
October 3, 2019 15:45
-
-
Save parzibyte/6ffe695c5732b7a857c530bb844d48f3 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
/* | |
Escribir un número decimal a binario usando leds | |
@autor parzibyte | |
@web parzibyte.me | |
*/ | |
#define PIN_CLOCK 2 | |
#define PIN_LATCH 3 | |
#define PIN_DATA 4 | |
void setup() { | |
/* | |
Al final de todo, son pines de salida, | |
y debemos establecerlos como tal | |
*/ | |
pinMode(PIN_CLOCK, OUTPUT); | |
pinMode(PIN_LATCH, OUTPUT); | |
pinMode(PIN_DATA, OUTPUT); | |
/* | |
Simplemente vamos a escribir un valor | |
*/ | |
digitalWrite(PIN_LATCH, LOW); //Le decimos que vamos a escribir algo... | |
shiftOut(PIN_DATA, PIN_CLOCK, LSBFIRST, 20); //Lo escribimos | |
digitalWrite(PIN_LATCH, HIGH) ; //Y le indicamos que lo guarde | |
} | |
void loop() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment