[question] Smart Lighting

I am doing a research for my final project on Smart Street Lighting using WSN, and it requires me to use LDR sensor, PIR sensor and dimmer for my project.

For AC Dimmer Circuit, It said that dim value=0 for maximum brightness and 128 for blackout. I tried to println dim value then the value is rising incrementally from 0 to 128 then dropping decrementally from 0 to 128. The lamp was changing its brightness randomly, but it didn't depend on dim value.I'm trying to make a smart lamp that will on when there's person around it and will off when nobody's around. Does anybody help me to resolv this one? i dont understand much since it is my first work with dimmer.

Thank you :)

"AC dimmer". Where is your circuit and program?

Please put your code in its own window as seen in other posts. This can be done by placing     [code] and [/code]  around the code. This makes it easier for others to read.