LED brightness control

if (dn = HIGH)

if (up = HIGH)

You need to add another = in these two statements. A single = is used for assignment. What you want is comparison which is ==