Page 246 ·
Robotics with the Boe-Bot
Example Program – IrInterferenceSniffer.bs2
√
Enter, save, and run IrInterferenceSniffer.bs2.
√
Test to make sure the Boe-Bot sounds the alarm when it detects IR interference.
You can do this with a separate Boe-Bot that’s running
TestIrPairsAndIndicators.bs2. If you don’t have a second Boe-Bot, just use a
handheld remote for a TV, VCR, CD/DVD player, or projector. Simply point
the remote at the Boe-Bot and press a button. If the Boe-Bot responds by
sounding the alarm, you know your IR interference sniffer is working.
' Robotics with the Boe-Bot – IrInterferenceSniffer.bs2
' Test fluorescent lights, infrared remotes, and other sources
' of 38.5 kHz IR interference.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
counter VAR Nib
DEBUG "IR interference not detected, yet...", CR
DO
IF (IN0 = 0) OR (IN9 = 0) THEN
DEBUG "IR Interference detected!!!", CR
FOR counter = 1 TO 5
HIGH 1
HIGH 10
FREQOUT 4, 50, 4000
LOW 1
LOW 10
PAUSE 20
NEXT
ENDIF
LOOP
Your Turn – Testing for Fluorescent Lights that Interfere
√
Disconnect your Boe-Bot from its serial cable, and point it at any fluorescent
light near where you plan to operate it. Especially if you get frequent alarms,
turn off that fluorescent light before trying to use IR object detection under it.
Always use this IrInterferenceSniffer.bs2 to make sure that any area where you are
using the Boe-Bot is free of infrared interference.