Basic Loop Program

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

Basic Loop Program

Postby King Creole » Thu Jan 02, 2014 1:31 pm

Hello! Total newbie here. I just got the Mindstorm EV3 for my 10-year old son and am trying to learn the basics in order to guide him. But I am not a technically minded person, and I know almost nothing about the software features. So, my question here is very simple: How do I program the robot to react immediately when the infrared sensor detects an obstacle?

I'm using the Track3r robot that my son built right out of the box. All I'm trying to do is get it to go forward, right 30º, and left 60º, over and over in a wide circle until the infrared sensor detects an obstacle, at which point it should back up and turn left.

It works, but the problem I have is that it runs through the whole forward cycle (forward, right, left) before backing up. I want it to react as soon as it detects an obstacle, i.e., if it turns right only 5º and detects a chair leg, I want it to back up immediately.

Here is a screenshot of how I programmed it. (The preview pane doesn't show the image. If it doesn't appear, I'll re-post it below.)

Image

[img][IMG]http://i61.photobucket.com/albums/h77/King_Creole/ev3_loop_scrnsht.png[/img][/img]
King Creole
New User
 
Posts: 2
Joined: Thu Jan 02, 2014 1:01 pm

Re: Basic Loop Program

Postby gloomyandy » Thu Jan 02, 2014 2:02 pm

Hi,
this may not be the best place to ask a question like this. Most folks here probably do not use the standard Lego supplied programming tools. You may want to try the mindboards forum:
https://sourceforge.net/apps/phpbb/mindboards/index.php

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3645
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Basic Loop Program

Postby King Creole » Thu Jan 02, 2014 2:27 pm

Okay. Thanks, Andy.
King Creole
New User
 
Posts: 2
Joined: Thu Jan 02, 2014 1:01 pm


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff