' TSL230R-Test.bs2 ' Configures TSL230R for x10 sensitivity ' Displays output in Debug Terminal ' {$STAMP BS2} ' {$PBASIC 2.5} '-----Define variables, set status of pins----- x VAR Word cnt VAR Word '-----Constant declarations------ S0 PIN 0 'Sensitivity selection pins S1 PIN 1 IN PIN 2 'TSL230 output pin '-----Program Start LOW S0 'Set sensitivity pins (S0,S1) to x10 HIGH S1 '-----Main program loop----- FOR x = 1 TO 2000 COUNT IN, 100, cnt 'COUNT on P2 FOR 100 ms, store value in cnt DEBUG HOME, DEC5 cnt 'Display value of cnt, as a decimal NEXT END