How to improve sensitivity?
arien009
Posts: 7
Hi,
Can I check how can I improve the sensitivity of my program execution of the Boe-bot?
'
[ Main Routine ]
DO
IF IN14 = 0 THEN
GOSUB Alarm
ELSE
GOSUB Test_Photoresistors
GOSUB Navigate
ENDIF
LOOP
'
[ Subroutine - Test_Photoresistors ]
Test_Photoresistors:
HIGH 7 ' Left RC time measurement.
PAUSE 3
RCTIME 7,1,timeLeft
HIGH 3 ' Right RC time measurement.
PAUSE 3
RCTIME 3,1,timeRight
RETURN
'
[ Subroutine - Navigate ]
counter VAR Word
Navigate:
IF (timeLeft < LeftThreshold) AND (timeRight < RightThreshold) THEN
PULSOUT 13, 850 ' Both detect flashlight beam,
PULSOUT 12, 706 ' full speed forward.
ELSEIF (timeLeft < LeftThreshold) THEN ' Left detects flashlight beam,
PULSOUT 13, 700 ' pivot left.
PULSOUT 12, 700
FOR counter = 1 TO 220
PULSOUT 15, 850
NEXT
ELSEIF (timeRight < RightThreshold) THEN ' Right detects flashlight beam,
PULSOUT 13, 800 ' pivot right.
PULSOUT 12, 800
FOR counter = 1 TO 220
PULSOUT 15, 650
NEXT
ELSE
PULSOUT 13, 750 ' No flashlight beam, sit still.
PULSOUT 12, 750
ENDIF
PAUSE 10 ' Pause between pulses.
RETURN
Can I check how can I improve the sensitivity of my program execution of the Boe-bot?
'
[ Main Routine ]
DO
IF IN14 = 0 THEN
GOSUB Alarm
ELSE
GOSUB Test_Photoresistors
GOSUB Navigate
ENDIF
LOOP
'
[ Subroutine - Test_Photoresistors ]
Test_Photoresistors:
HIGH 7 ' Left RC time measurement.
PAUSE 3
RCTIME 7,1,timeLeft
HIGH 3 ' Right RC time measurement.
PAUSE 3
RCTIME 3,1,timeRight
RETURN
'
[ Subroutine - Navigate ]
counter VAR Word
Navigate:
IF (timeLeft < LeftThreshold) AND (timeRight < RightThreshold) THEN
PULSOUT 13, 850 ' Both detect flashlight beam,
PULSOUT 12, 706 ' full speed forward.
ELSEIF (timeLeft < LeftThreshold) THEN ' Left detects flashlight beam,
PULSOUT 13, 700 ' pivot left.
PULSOUT 12, 700
FOR counter = 1 TO 220
PULSOUT 15, 850
NEXT
ELSEIF (timeRight < RightThreshold) THEN ' Right detects flashlight beam,
PULSOUT 13, 800 ' pivot right.
PULSOUT 12, 800
FOR counter = 1 TO 220
PULSOUT 15, 650
NEXT
ELSE
PULSOUT 13, 750 ' No flashlight beam, sit still.
PULSOUT 12, 750
ENDIF
PAUSE 10 ' Pause between pulses.
RETURN
Comments
Re: adding sensitivity on the cheap, you could use 2 similar photocells in series on each side. Doubles your resistance value range.