Giter VIP home page Giter VIP logo

Comments (9)

tttapa avatar tttapa commented on May 23, 2024

Master Reset and Output Enable are floating, and the bypass capacitor is missing. See this page: https://www.arduino.cc/en/tutorial/ShiftOut

from control-surface.

kentforth avatar kentforth commented on May 23, 2024

It is strange that author of this article made two different pinouts for a one shift register
pinouts are different.
pinout 1
pinout 2

I don't understand what pinout is the correct one.
Can you show me the picture how you connected leds by SPI with shift register when you tested leds?

from control-surface.

tttapa avatar tttapa commented on May 23, 2024

The second one is not a pinout, it's just the schematic, the pins have been rearranged to make routing of the wires easier. The first one is the actual pinout.

from control-surface.

kentforth avatar kentforth commented on May 23, 2024

Here is how I connected Arduino Leonardo to shift register by SPI. It works!
Thank you Pieter!
arduino leonardo shift register

from control-surface.

tttapa avatar tttapa commented on May 23, 2024

I just noticed that the breadboard view on the Arduino page is wrong. The bypass capacitor should be between Vcc and ground, as close to the chip as possible. The breadboard (and your diagram above) shows it between ST_CP and ground, which is completely wrong.

from control-surface.

kentforth avatar kentforth commented on May 23, 2024

I checked your suggestion, it works

from control-surface.

kentforth avatar kentforth commented on May 23, 2024

What if I want to connect leds to another shifter register. Can you show me a simple sketch with one led on one shift register and one led on the second shift register?

from control-surface.

tttapa avatar tttapa commented on May 23, 2024
#include <Control_Surface.h> // Include the Control Surface library.

using namespace ExtIO; // Bring the ExtIO pin functions into your sketch

// Instantiate a chain of shift registers with the SPI slave select pin as 
// latch pin, most significant bit first, and a total of 16 outputs.
SPIShiftRegisterOut<16> sreg = {SS, MSBFIRST};

const pin_t ledPinA = sreg.pin(0); // first pin of the first shift register
const pin_t ledPinB = sreg.pin(8); // first pin of the second shift register

void setup() {
  sreg.begin();             // Initialize the shift registers
  pinMode(ledPinA, OUTPUT); // You don't even need these lines, since
  pinMode(ledPinB, OUTPUT); // shift registers are always outputs
}

void loop() {
  // Toggle the state of the LEDs every 1/2 second
  digitalWrite(ledPinA, HIGH);
  digitalWrite(ledPinB, LOW);
  delay(500);
  digitalWrite(ledPinA, LOW);
  digitalWrite(ledPinB, HIGH);
  delay(500);
}

Change the latch pin from SS to pin 10 if you're using a Leonardo.

from control-surface.

kentforth avatar kentforth commented on May 23, 2024

Thank you! I appreciate your work!

from control-surface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.