' Robotics with the Boe-Bot – HalfLightSensitivity.bs2 ' Test Boe-Bot's photoresistor circuits with the PWM command cutting ' the phototransistor's light sensitivity in half. ' {$STAMP BS2} ' Target module = BASIC Stamp 2 ' {$PBASIC 2.5} ' Language = PBASIC 2.5 tLeft VAR Word ' Stores left sensor decay time tRight VAR Word ' Stores right sensor decay time PAUSE 1000 ' Wait 1 s before any DEBUG DO ' Main loop PWM 6, 184, 1 ' Charge cap to 3.59 V RCTIME 6, 1,tLeft ' P6->input, measure decay time PWM 3, 184, 1 ' Charge cap to 3.59 V RCTIME 3, 1,tRight ' P3->input, measure decay time DEBUG HOME, "tLeft = ", DEC5 tLeft, CR, ' Display results "tRight = ", DEC5 tRight PAUSE 100 ' Wait 0.1 seconds LOOP ' Repeat main loop