Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 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() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement