Let's Make Robots!

Why won't it vark?

I've made a development bot named Arcee as some of you know, now i've added an AmandaLDR to it for obstacle avoiding.The LEDs on the sensor are very bright and blue in colour. The bot won't use a servo to pan the sensor, it'll simply rotate itself.

The problem is, I don't think it's working. But the sensor works, oddly enough. It can turn an LED on at a threshold. But once implemented into an obstacle avoidance code it dosen't seem to work.

The code is attached below.



SHR_3_0.pde1.93 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Just checked your code dude. I am just sitting on the programming of my sharp sensor. IR is always a hardcore time...i like the easy way to put the code for a Ping sensor.

Anyway, you said that your sensor is working, how and can you reproduce it? Is it working just in theshold distance or do you get readings?

you might need to put a forward reading in look left ,right, and forward

also when you have finished your scan your pointing right and if it was to go left it would be pointing in the same direction as it was before the scan started

so drive forward till the reading gets above the threshold then scan left then right .you could return to the forward facing position and avoid from there or if you need to tern right you go forwards if you need to go left do 2 left terns so your pointing in the right direction  your real close a few extra lines it should go quite well


In your main loop you have Reverse() then a delay of 125 miliseconds. That's barely enough time to send a signal to the motors. Try 1200 or something. Does the scan function work as designed?