AWOL:
I don't see analogWrite (pin[k], analogRead (inputPin [k]) / 4); wouldn't work
what wouldn't work?, fading the LED?? i am thinking this is essentially the same as the example below 0.o??
void loop() {
// set the brightness of pin 9:
analogWrite(led, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}
Hint as to why analogWrite (pin[k], analogRead (inputPin [k]) / 4);is flawed:
==> Why you may need to use the map() function.
BTW - editing the top post makes it VERY hard for others to follow the thread as the earlier version of your question has disappeard, but the answers still stand in the thread. I do not get the connection between making a LED intensity follow an analog input and the triangle wave fader.