How can I change the brightness with a slider?

Yeah, you connected it up wrong… :-/

Take a look at my piccy at the beginning…