public LightSensor(AtmelMicrocontroller m, int adcChannel, String onPin, String powPin) {
mcu = m;
channel = adcChannel;
mcu.getPin(onPin).connect(new OnPin());
mcu.getPin(powPin).connect(new PowerPin());
fsm = new FiniteStateMachine(mcu.getClockDomain().getMainClock(), 0, names, 0);
ADC adc = (ADC)mcu.getDevice("adc");
adc.connectADCInput(new ADCInput(), channel);
}