SwenDomburg

Need some help with programming LEGO mindstorms EV3

Recommended Posts

Hello people, 

we need to make a car with  LEGO mindstorms ev3 for a school project. 
We need to do some challenges and races. 
We have some problems with programming the EV3 stone. Is it possible to use the motors handmatic with the commander app and for example when the lightsensor see a red line the electric motor will shut down automatic? 
Can someone tell me if this is possible and tell me how you can program this ? 

Thank you

Edited by SwenDomburg

Share this post


Link to post
Share on other sites

It's a bit hard to understand you question, but I will try to answer it...

It is not possible to program the EV3 with the commander app - it's only used as a remote control. :sceptic:

But it is quite easy to program it using a computer running the EV3 program - it's as simple as: Turn motors on -> Wait for light sensor to detect red -> Turn motors off. :wink:

Also, welcome to Eurobricks!

Share this post


Link to post
Share on other sites

Good question. If you only want to do 'simple' things with the EV3, I think you can use the remote. 

You can also make an app with AppInventor, but that's a bit more challenging. 

 

Hope this helps... And welcome to Eurobricks! :wink:

Share this post


Link to post
Share on other sites

@mocbuild101 thank you for your reaction. I will explain the problem. We have a sumo war challenge with 6 people in a circle. The circle line is red. The game is that you need to push someone else out of the circle. When your car is running over the line the motors needs to stop and your ev3 must play a sound. 
And someone else "said" it is possible ?? 

Share this post


Link to post
Share on other sites

Its certainly possible with the colour sensor.  Unfortunately, I'm a little rusty with the programming specifics but, I don't recall it being difficult to work out and I'm sure that someone else here will be able to point you in the right direction.

Share this post


Link to post
Share on other sites

Hello. I might help you. Just to clarify:

1. Are you allowed to use the EV3 Infrared Remote Controller to control/drive the robot?

Share this post


Link to post
Share on other sites

You could come and join our "Basic EV3" programming session next Tuesday @Deltion College in Zwolle. ±16.00 - 18.00 (PM if you want more info).

Share this post


Link to post
Share on other sites

The Programmer app or PC software will be required for what you are asking. You can create a loop that checks if the colour sensor has detected red, stop the motor, play a sound and then end the program. Once the program is on the Brick you can start it and also use remote control (IR) not sure about Bluetooth.

Share this post


Link to post
Share on other sites

Well. The thing is: You can´t program your car with the "Commander App". This App only allows you to "drive" the car. Example: you push one button = one motor runs.

That app only reads info from the EV3 sensors. That means that when your color sensor reads red, the apps will display the color red.

There's no way to introduce the functionality that you want, just because the "program" that the App uses is part of the EV3 firmware.

 

To really program your EV3 you need Lego Mindstorms Programming App or the Mac/PC software. That's where you "write" your program (It's not actually writing since the app uses graphic blocks)

To add the functionality that you mentioned, all you have to do is to introduce a parallel thread in your program like the picture shows.

That line has three blocks:

1. The execution of the thread waits in the first block until the color sensor reads red and then it continues to the second block.

2. This block stop the loop that actually controls/drives your car: the car stops.

3. This block plays a sound.

The real problem is the loop that control/drive your car. To answer you question: As far as I know, you can't write a program with the Lego Mindstorms Programing Software that actually listens the "Controller App".

You can write a loop that listens commands from:

1. The EV3 Remote Control (via Infrared Sensor)

2. Another EV3 Brick (via Bluetooth)

Untitled copy.png

Share this post


Link to post
Share on other sites

We have solved our problem. With the RemotEV3 app is it possible to drive the car manual and use a program on your brick at the same time. 
The only thing is that you can stop your program but you also need to stop running the car with the RemotEV3 app. 

 

Share this post


Link to post
Share on other sites

Nice trick. That's thinking outside the box. To definitely stop the car, just kill the Bluetooth connection. It's not elegant, but it works

Untitled.jpg

 

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.