Hi there!
I'm just trying around with my first Arduino Project, but I have some flickering with the ShiftPWM-Lib.
I use 4 74HC595B1 Shift Registers to control about 10RGB-LED-Stripes. The 10th Stripe has about 1m distance to the breadboard/arduino.
I don't use mosfets, but some ULN2001A to power the Stripes.
Here is my code so far:
const int ShiftPWM_latchPin=8;
const bool ShiftPWM_invertOutputs = false;
const bool ShiftPWM_balanceLoad = false;
#include <ShiftPWM.h> // include ShiftPWM.h after setting the pins!
unsigned char maxBrightness = 255;
unsigned char pwmFrequency = 100;
int numRegisters = 4;
int numRGBleds = int(numRegisters*8/3)-1;
int iDelay = 5;
void setup(){
Serial.begin(9600);
Serial.println("---------------");
Serial.println("Reset / Start");
Serial.println("---------------");
// Sets the number of 8-bit registers that are used.
ShiftPWM.SetAmountOfRegisters(numRegisters);
// SetPinGrouping allows flexibility in LED setup.
// If your LED's are connected like this: RRRRGGGGBBBBRRRRGGGGBBBB, use SetPinGrouping(4).
ShiftPWM.SetPinGrouping(1); //This is the default, but I added here to demonstrate how to use the funtion
ShiftPWM.Start(pwmFrequency,maxBrightness);
// Print information about the interrupt frequency, duration and load on your program
ShiftPWM.PrintInterruptLoad();
ShiftPWM.SetAll(0);
Serial.print("Maximum Brightness: ");
Serial.println(maxBrightness);
Serial.print("Delay is set to: ");
Serial.print(iDelay);
Serial.println("ms.");
Serial.print("Calculated RGB-LEDs: ");
Serial.println(numRGBleds);
Serial.println("---------------");
}
void loop()
{
ShiftPWM.OneByOneFast();
}
I also made a Video some weeks ago:
There you can see that the last Stripes are flickering / react too early. In natura it's even worse
I hope you can reproduce my problem and maybe could help me
Sorry for my (very) bad english and greetings from Germany,
Horst