SwenDomburg Posted September 26, 2017 Posted September 26, 2017 Hello everyone, Is there someone who knows how to let a car running random in a circle with walls 30 cm high. There will be a flashlight in a corner and the car needs to drive to the flashlight point. It isn't really hard when you have 2 different motors for steering. But we have a car with a seperate steering wheel like a forklift truck. Thankss !! Quote
thekitchenscientist Posted September 26, 2017 Posted September 26, 2017 It should be a pretty similar program to the ones for finding the ir beacon. I would suggest you use a couple of array blocks to hold data from the light sensor. Pick a random direction (left or right), lock the steering, drive forward and collect a dozen readings to one array. Back up the same amount as you went forward. Set the steering to opposite lock and repeat into the other array. Whichever has the highest brightness is the direction to head. If no flashlight is detected perhaps steer a random direction to turn 90 degrees and repeat. I guess you will need touch sensor to locate the wall. The light sensor can also do this to give front and back coverage. Quote
mocbuild101 Posted September 27, 2017 Posted September 27, 2017 Here's a completely "thinking outside the box" solution: Mount the light sensor on a motor, which can then scan for the flashlight - without the car even moving. After finding the direction of the light, have the car move toward it. 8 hours ago, thekitchenscientist said: I guess you will need touch sensor to locate the wall... ...or a ultrasonic sensor Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.