For part one—making my lamp respond—I used a photocell to detect light and had the light fade in if the threshold of light became too low. It would then fade in if the amount of light was higher than the threshold. Not rocket science, but I’m not a rocket scientist.
I originally took code from the Arduino AnalogInput example, then added bits of the analog fading example, then wrote some of my own code to make sure the light stayed on.
I went for simple on this one, and interrupted the current by connection on wire to a push tack and another wire to a second push tack. The connection is made when a metal ruler is place on the push tacks, which act as a holder. An LED lights up to indicate that the ruler is back in its place.