GP2D12 Problems

Hello everyone!
It’s been a couple months since my BRAT has been assembled, and I just finally reassembled it. Now I seem to be facing a problem…

My GP2D12 sensor isn’t–or at least hasn’t been working at all since I got it. I tried using EVERY single Manual, Program, everything on the lynxmotion site and I can’t seem to get it to work with my Basic Atom 28.

I’m pretty sure I’m wiring it correctly, and yes, its plugged in to the Bot Board. And there’s nothing wrong with my Bot Board/Basic Atom because I have tested all other programs and they seem to work.

At this point, I don’t know what to do. Should i get a new one? or should I keep troubleshooting?

Thanks!

It turns out my sensor does work. I’ve been trying to get it to work all day now and now it starts working…

Anyway, if anyone else has any problems, use the code I made to test it:

;======================================================
;******************************************************
;************** Sharp GP2D12 Sensor Test **************
;******************************************************
;*** Use this program to test your GP2D12 IR Sensor ***
;******************************************************
;====================================================== 
			
			
				;Variables
sensor var word
cr con 13
nul con 0
lf con 10
bs con 8
bel con 7

value var word
main:		;main loop for the program

adin AX0,1,ad_ron,sensor 	;Return the value of the sensor
value = sensor / 32 		;make the value easier to read
debug [dec value,cr] 		;Return information to the debug window

goto main 		'loop