Ping blinds my Penguin?
So i have a new RevB penguin, and when i plug a ping sensor into the front expansion port it renders the Right (looking him in the face) IR emitter inoperable.
I have tried two pings with the same results.
I have tried using the rear expansion port, and the emitters work fine.
I have tried plugging a PIR in the pront expansion port, and oddly enough the emitters work fine.
I have also tried placing the ping just behind the expansion port without plugging it (thinking it may be reflecting or something) and the emitters still work fine.
Any ideas? Thanks in advance!
P.S. I'm using this code to test.
I have tried two pings with the same results.
I have tried using the rear expansion port, and the emitters work fine.
I have tried plugging a PIR in the pront expansion port, and oddly enough the emitters work fine.
I have also tried placing the ping just behind the expansion port without plugging it (thinking it may be reflecting or something) and the emitters still work fine.
Any ideas? Thanks in advance!
P.S. I'm using this code to test.
IrInput PIN 4 REmitter CON 2 LEmitter CON 3 LeftIr VAR Bit RightIr VAR Bit time VAR Word DEBUG CLS ' Prepare debug screen DEBUG "Infrared sensor status:", CR, "Left:", CRSRXY, 15, 1,"Right:", CR DO GOSUB ReadIr GOSUB READPING ' Update debug screen with DEBUG CRSRXY, 6, 1, DEC LeftIr ' status of IR sensors DEBUG CRSRXY, 22, 1, DEC RightIr DEBUG CR, "Distance = ", DEC4 time, " cm",CR ' centimeter display PAUSE 150 LOOP ReadIr: FREQOUT LEmitter,1,6300 ' Modulate emitters at 38KHz LeftIr = ~IrInput ' and check for reflections FREQOUT REmitter,1,6300 RightIr = ~IrInput RETURN ReadPing: PULSOUT 5, 5 ' start pulse PULSIN 5, 1, time ' store ping echo round trip time time = time ** 2080/2 RETURN
Comments
i also think that if it where a battery problem, port 2 would also blind the penguin, but it doesn't.
when i plug the ping in only the right emitter will goto 1 when i wave my hand in front of it (about 4 cm away).
As soon as i pull the ping, both the left and the right emitters will goto 1 when i wave my hand in front of it.
the range of the ping seems to be correct, when i put my hand at 10 cm, it finds it at 10 cm.
when i put the ping in the rear port both emitters will goto 1 and the ping reports the proper range.
PenguinCode-v1.3 (.zip)
using the just ir demo, i get the same results. if the ping is in, no left IR.
gently wiggling doesn't seem to have an effect.
i also tried plugginng in a few 2 pin devices, with just the IR test code running.
PIR - both emitters work fine
2 line serial LCD - has the same effect as the ping.
so both the PING and the LCD cause this problem to happen, but not the PIR. it seems that the higher current draw of the PING and LCD maybe causing the problem?
But wait - you didn't say if this is a fixed Penguin. Unless you or someone personally modified the Penguin board to install the repair parts, it will not operate with the usb cable detached.
i did do the rework, however i did not test him with the ping before i did it. i did calibrate, and have him walking tethered before i did the rework, and he migrates north quite well unteatherd, after the rework.
i have been sitting here watching the output of the IR test code (without the ping), with the penguin head looking at a wall and i have noticed the right eye holds "1" constantly, but the left slips to "0" off and on quite a bit. maybe the problem is with the emitter it self that gets exacerbated by extra current draw on the bus?
I'm guessing he uses the emitter that parallax sells correct?