Breadboard for "Shift Register"

shift-register.png

Fritzing diagram: shift-register.fzz

 

Run this example from the command line with:

node eg/shift-register.js
const {Board, ShiftRegister} = require("johnny-five");
const board = new Board();

// For use with 74HC595 chip

board.on("ready", () => {
  const register = new ShiftRegister({
    pins: {
      data: 2,
      clock: 3,
      latch: 4
    }
  });

  let value = 0b00000000;
  let upper = 0b10001000;
  let lower = 0b00010001;

  function next() {
    register.send(value = value > lower ? value >> 1 : upper);
    setTimeout(next, 200);
  }

  next();
});

 

Component Classes in this example:

Hi! The Johnny-Five community is building new projects every day. We made this newsletter to tell you about what's new, what's good, and what's next for Open Source robotics. Join us in exploring what we can make together.

Fork me on GitHub