'-------------------------------------- 'ldetect.bs2 Arrick Robotics ' www.robotics.com ' 'This routine demonstrates detecting 'light using a CDS cell. The light level 'is read by determining the time it takes 'to charge the capacitor. The CDS cell 'changes resistance as the light intensity 'changes. This changes the current that 'charges the capacitor. The time is 'measured and the output result is then 'displayed to the debug screen. light var word 'Light variable. main pause 500 'check each 1/2 sec. low 2 'drain cap. pause 50 'wait for cap to drain. rctime 2,0,light 'Find time. debug ? light 'Display. goto main 'do forever.