Jeff,
Thanks for all your help, got it mostly tweaked , now to get it installed.
will upload pictures once that’s done.
Here’s phase 2 of the same project ( this works ) but there might be a simpler or better way to accomplish it without the paging effect. the idea is just fade from full saturation to pure white via a gpio - input pin, and keeping the ability to adjust the intensity and color.
(((((
“Here’s the code as I have it now”
totalSpace = pixelCount * 10 // single pixel render
stripaint = totalSpace - pixelCount
color = pixelCount
intense = pixelCount
speed = 0.004
powerPin = 4
pinMode(powerPin, INPUT_PULLUP)
export function power§ {direction = (p > 0.5) ? -1 : 1}
export function beforeRender(delta) {
stripaint += speed * delta * direction
stripaint = clamp(stripaint, 0, totalSpace - pixelCount)
}
// selects the color to be rendered
export function sliderColor(h){ color = h}
color < 1
// controls overall brightness of the pixels
export function sliderIntensity(h){ intense = h}
intense < 1
export function render(index) {
// pixel saturation via power status input
if (digitalRead(powerPin) == 1) { direction = -1
} else { direction = 1
}
// pixel saturation level call points
position = stripaint + index
if (position < pixelCount) { hsv(color, .1, intense) } else
if (position < 2 * pixelCount) { hsv(color, .2, intense) } else
if (position < 3 * pixelCount) { hsv(color, .3, intense)} else
if (position < 4 * pixelCount) { hsv(color, .4, intense) } else
if (position < 5 * pixelCount) { hsv(color, .5, intense) } else
if (position < 6 * pixelCount) { hsv(color, .6, intense) } else
if (position < 7 * pixelCount) { hsv(color, .7, intense) } else
if (position < 8 * pixelCount) { hsv(color, .8, intense) } else
if (position < 9 * pixelCount) { hsv(color, .9, intense) } else
{ hsv(color, 1, intense) }
}
Its a variable of the other one " this one will only be rendering a single pixel.
“” Side note I’m trying to figure out a way to get the PWM drive to ride on the power leg “”
this end goal it to use existing wiring for the application. I’ll keep you posted on that endeavor.