hey guys, programming problem wth me, i just gor the Sharp GP2D12 IR Sensor and i want to detect thing like that, but when i run Jim’s code from the tutorial for the 4wd rover for autonomous operation, it doesn;t seem to work, all the numbers in ternimal 1 are like 510,511, 508, sticking just around there, and even when i wave my hand in from of it it doesn’t work, only is i move my hand very fast in front of it does it get any type of result, usually dropping down into the 400 range
heres the tutorial btw, i dl and ran this program that i changed to work for only 1 sensor, gp2d12bb.bas
IDK. It should work. All I can say is, did you hook up the sensors right? Battery on? 5V jumper on the pins there setup on? Program it right? hmmmm, thats got me stumped!
well, if i hooked the sensor up wrong it wouldn’t be giving me any feedback at all, and yea, i have the jumper on 5 volts, and thats what im asking about, the program
99.21 - 10 cm
99.21 - 10 cm
97.85 - 10 cm
97.85 - 10 cm
97.07 - 10 cm
96.87 - 10 cm
96.48 - 10 cm
96.67 - 10 cm
97.26 - 10 cm
97.46 - 10 cm
97.65 - 10 cm
99.80 - 10 cm
99.60 - 10 cm
99.21 - 10 cm
99.21 - 10 cm
99.21 - 10 cm
98.24 - 10 cm
98.82 - 10 cm
99.21 - 10 cm
98.04 - 10 cm
98.24 - 10 cm
99.80 - 10 cm
98.04 - 10 cm
98.24 - 10 cm
98.82 - 10 cm
99.02 - 10 cm
99.60 - 10 cm
99.21 - 10 cm
99.02 - 10 cm
98.63 - 10 cm
98.82 - 10 cm
99.02 - 10 cm
98.43 - 10 cm
98.24 - 10 cm
98.82 - 10 cm
98.82 - 10 cm
99.21 - 10 cm
98.43 - 10 cm
98.24 - 10 cm
97.65 - 10 cm
97.46 - 10 cm
97.65 - 10 cm
97.46 - 10 cm
97.85 - 10 cm
97.85 - 10 cm
97.85 - 10 cm
97.85 - 10 cm
that is what i get when i wave my hand quickly in front of the IR sensor
99.21 - 10 cm that is what it is if nothing is moving in front of it, also the thing is, the IR sensor doesn’t pick anything up if it is not moving
the baud rate wont work on 57.6 kbs, it will only work on 9600 for some reason
please ignore the above post, i was using the wrong section of code
scratch that, i got the baudrate to go back to normal, and not im reading 510 and down, ill take another hand waving in front of the thing again
Left 508
Left 508
Left 511
Left 515
Left 514
Left 512
Left 508
Left 509
Left 510
Left 513
Left 509
Left 510
Left 513
Left 510
Left 511
Left 514
Left 512
Left 508
Left 509
Left 510
Left 512
Left 508
Left 508
Left 509
Left 510
Left 512
Left 488
Left 487
Left 489
Left 489
Left 488
Left 486
Left 487
Left 489
Left 488
Left 487
Left 488
Left 489
Left 488
Left 487
Left 489
Left 488
Left 486
Left 487
Left 489
Left 488
Left 486
Left 487
Left 489
Left 489
Left 488
Left 486
Left 487
Left 489
Left 488
Left 487
Left 488
Left 487
Left 489
Left 489
Left 488
Left 486
Left 487
Left 489
Left 488
Left 487
Left 488
Left 487
Left 489
Left 488
Left 487
Left 488
Left 487
Left 489
Left 489
Left 488
Left 486
Left 487
Left 489
Left 488
Left 487
Left 489
Left 488
Left 487
Left 489
Left 488
Left 487
Left 488
Left 487
Left 489
Left 488
Left 487
Left 488
Left 487
Left 489
Left 488
Left 487
Left 488
Left 487
Left 489
Left 489
Left 488
Left 486
Left 487
Left 491
Left 492
Left 492
Left 491
Left 492
Left 492
Left 492
Left 491
Left 493
Left 493
Left 493
Left 494
Left 496
Left 494
Left 495
Left 499
Left 500
Left 499
Left 501
Left 501
Left 501
Left 502
Left 503
Left 506
Left 507
Left 509
Left 511
Left 514
Left 512
Left 508
Left 508
Left 508
thats waving my handly slowly in and out of the range of the IR, but it still wont give me a solid value, my hand has to be in motion
, now prepare yourselves, cause this is the really confusing part, i was playing around with the IR trying to get it to work, when, i accidently hit it and the IR comes unplggued…funny though, cause values kept coming up in Terminal 1 window, so i tested my theory and i clicks “Disconnect” then “connect” again, and it still gave me values
could someone shed some light on this? im at a complete lose here
it was actually the way the baord is set up, the AUX pins are labeled one off from what they actually are, so while i was thikning i was on Pin 1, i was actually on Pin 2, look at your boards and you’ll see what i mean
well, since i got the IR right, i have amde a simple code to learn how the IR works and see what i can do with it, right now if the sensor “sees” something about 7 inches away it turns away, waits 2 seconds, then goes back to a canstant postioston i set, not much, but its a start
[code]
left_detect var word
main:
adin ax2, 2, AD_RON, left_detect
serout S_OUT, i57600 ," Left ", dec left_detect, 13]