ShiftPWM Code error (use 74HC595)
im using 3 shift registers project.(8 rgb leds)
just try blow code,but work in 1 time.not continuously. can me fix it?
just try blow code,but work in 1 time.not continuously. can me fix it?
code: [select]
const int shiftpwm_latchpin=8;
const bool shiftpwm_invertoutputs = true;
const bool shiftpwm_balanceload = false;
#include <shiftpwm.h>
unsigned char maxbrightness = 255;
unsigned char pwmfrequency = 75;
int numregisters = 3;
int numrgbleds = numregisters*8/3;
void setup(){
serial.begin(9600);
shiftpwm.setamountofregisters(numregisters);
shiftpwm.setpingrouping(1);
shiftpwm.start(pwmfrequency,maxbrightness);
}
void loop()
{
chase(100);
}
void chase( int wait)
{
(int j=0; j<10; j++)
(int q=0; q < 3; q++)
{
(int i=0; < 8; i=(i+3))
{
shiftpwm.sethsv(i+q, 200,255,100);
}
delay(wait);
(int i=0; < 8; i=(i+3))
{
shiftpwm.sethsv(i+q, 0,0,0); //turn every third pixel off
}
}
}
that code should run continuously. running exact code?
Arduino Forum > Using Arduino > LEDs and Multiplexing > ShiftPWM Code error (use 74HC595)
arduino
Comments
Post a Comment