Yeah, I know the fade works if there is no x, I wrote the function, and x is mapped to 1, 5. Whats the point of /17?
The problem is the change of the x resulted in random data in the output val.
BTW, I switch the transistor to a single led connected to 5v output, the result is the same.