I am currently trying to control a TI 74HC595 Shift register using my ESP32 DevKit C. I think my problem seems to do with the data stream or clock rate. I try and turn a single output on and off in a loop and the high bit takes up 3 outputs and rather than turn off, it shifts the bit down a few pins.
Code: Select all
#include <Wire.h>
#include <MultiShiftRegister.h>
const int latchPin = 12; //ESP32 Pin 12
const int clockPin = 14; //ESP32 Pin 14
const int dataPin = 27; //ESP32 Pin 27
MultiShiftRegister msr (1, latchPin, clockPin, dataPin);
void setup() {
Serial.begin(9600);
pinMode(latchPin, OUTPUT); //Setting Pin Orientation
pinMode(clockPin, OUTPUT); //Setting Pin Orientation
pinMode(dataPin, OUTPUT); //Setting Pin Orientation
delay(500);
}
void loop() {
msr.set_shift(1);
delay(2000);
msr.clear_shift(1);
delay(2000);