ESP8266 and ShiftOutX - pinOff issues

I have a prototyping board built with an ESP8266 (Wemos D1 mini) and 4x74hc595 shift registers. Using the ShiftOutX library I can write to all the pins and sequentially turn them on : I go from 1 to 32 lights on, all good. Based on that I have no concerns about the hardware side.

However, if I turn one on (pinOn) then turn it off (pinOff) , the next one on and turn it off, etc, I only get the first set of 8 LEDS to respond - nothing else turns on. I've tried using allOff instead of pinOff, which has the same result. I also tried using both a numeric value (i.e. 128) as well as shPinxx as the target for any pin over 8, and the same results there also.

I'm suspecting this could be an issue with using this library on an ESP8266 but if anyone else has been able to successfully use it to turn specific pins on and off in the range 9-32 I'd be interested to hear.

Please post the sketch that exhibits the problem that you are describing

Hi,
If possible, also post a video showing the problem

This is the working code that sequentially writes to every pin. In the photo you'll see them all on (didn't do video it was massive !)

#include <ShiftOutX.h>
#include <ShiftPinNo.h>
//this are the input parameters to the class constructor
//shiftOutX(_latchPin, _dataPin, _clockPin, _bitOrder, _NofRegisters);
shiftOutX regOne(13, 12, 15, MSBFIRST, 4);
 
void setup() {
 
}
 
void loop() {  

  delay(1000);
  regOne.allOn(); //turn all the pins on
  delay(1000);
  regOne.allOff(); //turn all the pins off
  delay(1000);

  for (int i=0;i<31;i++)
  {double ledval=pow(2,i);
  regOne.pinOn(ledval);
  delay(100);

  }

  delay(1000);
  regOne.allOff(); //turn all the pins off
  delay(1000);
 
}

Then I used this code

#include <ShiftOutX.h>
#include <ShiftPinNo.h>
//this are the input parameters to the class constructor
//shiftOutX(_latchPin, _dataPin, _clockPin, _bitOrder, _NofRegisters);
shiftOutX regOne(13, 12, 15, MSBFIRST, 4);
 
void setup() {
 
}
 
void loop() {  

  delay(1000);
  regOne.allOn(); //turn all the pins on
  delay(1000);
  regOne.allOff(); //turn all the pins off
  delay(1000);

  for (int i=0;i<31;i++)
  {double ledval=pow(2,i);
  regOne.pinOn(ledval);
  delay(100);
  regOne.pinOff(ledval);
 delay(200);
  }

  delay(1000);
  regOne.allOff(); //turn all the pins off
  delay(1000);
 
}
 

Seems like I cant upload video... but it just does the LEDS on the first SR, but non of the others. Also, the 'allOn' function only seems to apply to the first SR when the second set of code is used

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.