Task #2 Basic Robot Programming

Ariel Safiya Taylor                                          Robotics: Task 2

Summary: In this task, the objective was to program the robot to move in a closed shape and return to the starting position. We were to use NXT and RobotC to program the movements of the robot to travel in a straight line with a distance of 2 meters. Also we were to add a sensor to the robot and program the robot to respond by moving according to the values given to the sensors.

What you have learned: I learned that although the motors connected to the robot may be set to the same value, they results can differ depending on the power of the individual motors. Trial and error helped find adequate values so that the movement was accurate enough to move in the intended direction.

Challenges:  A challenge I had with this task was getting my sensor to recognize an object so that it can react and move in the programmed direction. In my case, I used the touch sensor which was to detect bumping into an object and move in reverse away from the object. When I ran the code, the sensor hesitated before it would react to the touch of an object.

Constraints:  This was my first task so trying to learn the RobotC language in a short time was a constraint in coding the movement using this language.

Observations:  I realized that testing the codes are very important in finding out the errors within the program. Trial and error help solve these errors as some values need to be adjusted to accommodate to proper movement of robot.

This is a screenshot of the NXT program I used in creating a straight line. I choose to use seconds to determine the duration of the movement. This also helped with getting the robot to travel a distance of 2 meters and stop. I did not want to use full battery power because I thought it would move too fast and stopping would be a bit difficult.

For creating a square shape I used a looping technique because it returns to the starting position precisely. The movement has turns and forward movement with the same value giving the closed shape equal dimension.

The last screenshot of my NXT programs is the touch sensor program that is supposed to move forward in a straight line until it hits an object then it is supposed to move in reverse if the sensor is activated. A very simple program because the touch sensor has only 2 values which are 1 and 0 which represents the state of the button. So while the button is not touched it should keep moving forward.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s