The data is stored in an array and is accessed at the end of the 24-hour period using the on-screen prompts. The data you receive represent the number of times the beam was broken in that hour period. The period with the highest number was presumably the hour of greatest activity. A problem may occur in which the organism breaks the beam and then remains in it--try to avoid this by placing food and water sources away from the photogate area.
An alternative to the cockroach/Tygon tubing experiment would be one in which the photogate would detect the running wheel activity of a rodent. An attachment to the wheel would have to be fashioned which extended out and broke the light beam of the photogate as the wheel rotated. Rodents have been used very successfully in experiments involving biological timing since they have a very pronounced activity cycle. The set-up would have to be placed in an area that was undisturbed, since the noise of a class of students or the lights being turned off and on may disrupt normal activity rhythms.
10 HOME 15 REM *SETS UP MEMORY LOCATIONS* 20 B1=49249 30 B2=40250 35 REM *INITIALIZE DATA-STORAGE ARRAY* 40 DIM TRY(240) 50 COUNT=0: ROACH=0: V=0: LAST=0 55 REM *SETS PROGRAM TO RUN FOR 24 HOURS* 60 FOR J=1 TO 981032 70 COUNT=COUNT+1 75 REM *CHECKS TO SEE IF BEAM IS BROKEN* 80 IF PEEK(B1)<127 THEN GO TO 110 90 LAST=0 100 GO TO 600 110 IF LAST=O THEN GO TO 130 120 GO TO 600 130 ROACH=ROACH+1 140 LAST=1 145 REM *CHECKS FOR INPUT FROM OTHER PORT* 150 IF PEEK(B2)>127 THEN GO TO 205 155 REM *PLACES DATA INTO ARRAY* 160 TRY(V)=ROACH 170 V=V+1 180 COUNT=0 190 ROACH=0 200 GO TO 70 205 REM *SHOWS RESULTS ON SCREEN WHILE RUNNING* 210 PRINT "TIME: "COUNT 220 PRINT "ROACH CROSSINGS: "ROACH 230 IF COUNT=3747 THEN GO TO 160 240 NEXT J 250 HOME 255 REM *DISPLAY DATA AT END OF RUN* 260 PRINT "------------------------" (<--there are 24 dashes) 270 PRINT "DATA RETRIEVAL" 280 PRINT "------------------------" 290 PRINT 300 PRINT "THIS PROGRAM WILL SHOW YOU A" 310 PRINT "SCREEN AT A TIME. TO CONTINUE" 320 PRINT "VIEWING DATA, ENTER 1 WHEN PROMPTED." 330 PRINT 340 FOR HOUR=1 TO 24 350 PRINT "HOUR "HOUR 360 FIRST=(HOUR-1)*10 370 LAST2=(HOUR*10)-1 380 FOR Z1=FIRST TO LAST2 390 PRINT TRY(Z1) 400 NEXT Z1 410 PRINT "TO CONTINUE--" 420 PRINT "PRESS 1" 430 PRINT "TO EXIT PROGRAM, PRESS 0" 440 PRINT 450 INPUT "CONTINUE? ";XY 460 IF XY=0 GO TO 500 470 IF XY=1 GO TO 490 480 GO TO 4025 490 NEXT HOUR 500 END