Sharp IR sensor problems

I’m pretty new to building robots and started building the “Build your first robot” on the sites homepage. I didn’t run into any issues until I came to programming the IR sensor. I used the debug command to see what values it was reading to see they weren’t really changing at all. The numbers were around 250 constantly barely changing. If I put a box about 5 inches from it the numbers stayed the same, no matter how close or far the box was. The best thing I could get to happen is if I turned the sensor while it was reading it would fluctuate to around the 180’s but than just got back up to around 250 even if there was something in front of it. I tried putting my own female heads on the wires and plugged them into the board in a different order but that didn’t do anything but change the numbers to stay at the 10’s instead of 250’s. I’m very new to robotics so I don’t know much about how to use picaxe programming or robotics in general so if someone could help me out with some things to try and what order to truly plug in the wires that would be great… thanks

More info

"I tried putting my own female heads on the wires and plugged them into the board in a different order"

That’s not a good idea before asking for help.

I thought this pic from here made it perfectly clear where the wires connect.

Headpins.jpg

How did you write the debug command?

How are you powering it?

There is how it is currently

IMG_2147_1_.jpg

There is how it is currently plugged in (matches the picture). when i orginally got the sensor the female heads at the end were connected together and the black and yellow wire had switched spots so it went yellow, black red but i had read that someone else had noticed that and put their own heads on and put them inthe correct black yellow red order so i tried that but it only changed the numbers from staying in the 250's to the 10's.  I copied and pasted the debug command from the instructions on the post. Is it likely or anyway to test if it's fried?

perhaps it was faulty from new

If you have a multimeter you can test the output from the yellow wire and see if it varies voltage by distance. If it does then you can bet your code is wrong. If it is constant then you can bet your sharp is faulty.

Just for my information,

what part number is the sensor you are using? I want to look at the datasheet.