Marv
Got a question. After getting my Ultrasonic module setup to handle front-end obstacles ok on my 4WD, I thought I would use an extra Sharp IR sensor I had laying around on the back end of my 4WD. Wouldn't want to back my rear into a buzz-saw...
The Sharp sensor works as it should on the 3 ADC panels just fine. It also works ok on the Sharp IR Distance/Sharp IR Collision Detection panel. By "ok", I mean it stops forward motion if it senses my hand. It has no effect on reverse motion, which was the reason I mounted it on the rear to start with, but that's not the reason for my post.
The problem is that the Sharp IR Distance/Sharp IR Radar panel doesn't seem to sense anything from the Sharp sensor. The radar beam and servo sweep, but never show any red blobs on the screen like the ultrasonic module. As a result, the drive motors just keep on rolling.
Any ideas or suggestions?
I should say I'm using the Sharp gp2y0a21yk0f IR sensor, which is supposed to be the replacement for the Sharp gp2d12 DJ used in his tutorial. Apparently, the gp2d12's are discontinued and very hard to find. But I don't think that's the issue, as the other panels work ok with my sensor.
Thanks!
Update: I tried my hand at using EZ-Script to write a few lines of code to retreive the values being returned by my Sharp IR sensor. I get a 1 reading with nothing in front of the sensor, and a maximum of 160 with my hand about 3" in front of the sensor.
So, then I modified the Custom Object Avoidance script under Examples using a value of > 100 in the if loop, and it works ok - the drive motors stop, turn, etc. when I put my hand in front of the Sharp sensor.
What I take away from this is that the Sharp IR sensor returns a higher value when it sees something, while the Ultrasonic sensor returns a lower value when it sees something.
I may be missing something here, but it looks to me like the Sharp IR Radar Panel handles the Sharp sensor the same as the Ping Radar Panel handles the Ultrasonic sensor, which isn't going to work?
Oh! I'll look into that and fix the sharp radar control if it is indeed reversed Thank u!