I'm trying to create a "rainbow" effect with all 6 pins on the digispark. I want the led's to become brighter, then darker. The code
should work, but isn't. Anyone see the misstake I made?
This is the effect I'm trying to achive:

code:
#include <TinySoftPwm.h>
int value[] = {
0,43,86,129,152,193};
boolean rising[] = {
true,true,true,true,true,true};
void setup()
{
TinySoftPwm_begin(128, 0); /* 128 x TinySoftPwm_process() calls before overlap (Frequency tuning), 0 = PWM init for all declared pins */
}
void loop()
{
static uint32_t StartUs=micros();
static uint32_t StartMs=millis();
static uint8_t Pwm=0;
static int8_t Dir=1;
/***********************************************************/
/* Call TinySoftPwm_process() with a period of 60 us */
/* The PWM frequency = 128 x 60 # 7.7 ms -> F # 130Hz */
/* 128 is the first argument passed to TinySoftPwm_begin() */
/***********************************************************/
if((micros() - StartUs) >= 60)
{
/* We arrived here every 60 microseconds */
StartUs=micros();
TinySoftPwm_process(); /* This function shall be called periodically (like here, based on micros(), or in a timer ISR) */
}
/*************************************************************/
/* Increment/decrement PWM on LED Pin with a period of 10 ms */
/*************************************************************/
if((millis()-StartMs) >= 10)
{
/* We arrived here every 10 milliseconds */
StartMs=millis();
/* for each of the 6 pins*/
for (int i = 0; i < 6; i++)
{
if(rising[i])
{
value[i]++;
if(value[i] == 256)
{
rising[i] = false;
value[i] = 254;
}
}
else
{
value[i]--;
if(value[i] == -1)
{
rising[i] = true;
value[i] = 1;
}
}
TinySoftPwm_analogWrite(value[i], i);
}
}
}Thanks DeuxVis for the code tag

TinySoftPwm_analogWrite(PIN, VALUE) -> TinySoftPwm_analogWrite(VALUE, PIN)