' Acquire and report photo cell resistances ' as formulas =rr(c)/ii(c) baud con 16468 select con 5 scale con 128 rr var word (3) ii var byte (3) c var byte s var byte(14) s(14)=0 in: serin 1,baud,[str s\13\cr] for c = 0 to 2 gosub sense next out: serout 2,baud,[str s] for c = 0 to 2 serout 2,baud,[" =", dec rr(c), "/", dec ii(c)] next serout 2,baud,[cr] goto in sense: x var word rr(c) = 0 for ii(c) = 1 to scale high 0 low select+c output select+c rctime 0,1,x input select+c if x=0 then in ' missing data rr(c) = rr(c)+x if rr(c)>1000 then enough ' enough data next ii(c) = scale enough: return