SwenDomburg Posted September 21, 2017 Posted September 21, 2017 (edited) 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 September 21, 2017 by SwenDomburg Quote
mocbuild101 Posted September 21, 2017 Posted September 21, 2017 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. 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. Also, welcome to Eurobricks! Quote
Paul Klop Posted September 21, 2017 Posted September 21, 2017 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! Quote
SwenDomburg Posted September 21, 2017 Author Posted September 21, 2017 @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 ?? Quote
Boulderer Posted September 21, 2017 Posted September 21, 2017 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. Quote
dagupa Posted September 21, 2017 Posted September 21, 2017 Hello. I might help you. Just to clarify: 1. Are you allowed to use the EV3 Infrared Remote Controller to control/drive the robot? Quote
SwenDomburg Posted September 21, 2017 Author Posted September 21, 2017 @dagupa We don't have this one. We only have the sensors and the ev3 brick and our own build car. Quote
JopieK Posted September 21, 2017 Posted September 21, 2017 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). Quote
thekitchenscientist Posted September 21, 2017 Posted September 21, 2017 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. Quote
dagupa Posted September 21, 2017 Posted September 21, 2017 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) Quote
SwenDomburg Posted September 22, 2017 Author Posted September 22, 2017 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. Quote
dagupa Posted September 22, 2017 Posted September 22, 2017 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 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.