SwenDomburg

Lego EV3 Program blocks help

Recommended Posts

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 !! 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Here's a completely "thinking outside the box" solution:

  1. Mount the light sensor on a motor, which can then scan for the flashlight - without the car even moving.
  2. 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 :look:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.