Mindstorms Programming Exercise Prelab

From EG1004 Lab Manual
Revision as of 20:17, 27 October 2005 by Admin (talk | contribs)
Jump to: navigation, search

RoboLAB Programming Exercise

This exercise is due at the beginning of the Sensors Lab, and counts as the quiz for the Sensors Lab.

This assignment will introduce you to the fundamentals of ROBOLAB programming. Each student will be assigned a programming task by their TA. You will write a program in ROBOLAB that uses sensors to complete the task assigned to you.

Program A

This program will run motors A and B, reversing motor A after 4 seconds. Then, it will stop motors A and B when touch sensor 2 is released.

Important: Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program B

This program will run motor A while touch sensor 3 is released.  When touch sensor 3 is pressed, motor A will reverse for 2 seconds and stop.

Important: Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program C

This program will run motor A when light sensor 2 is less than 35. When light sensor 2 is greater than 35, it will reverse motor A for 6 seconds and then stop the motor.

Important:  Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program D

This program will run motor A after 3 seconds when touch sensor 3 is released and then reverse motor A for 3 seconds when touch sensor 3 is pressed.  This program should continually check the sensor’s state by jumping to the beginning.

Important:  Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program E

This program will run motors A and B until touch sensor 3 is touched, and then will reverse the motor for 3 seconds and then all motors stop.

Important:  Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program F

This program will run motor A after 3 seconds when light sensor 3 is greater than 40 and then reverse motor A for 3 seconds when light sensor 3 is less than 40. This program should continually check the sensor’s state by jumping to the beginning.

Important:  Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program G

This program will run motors A and B and wait for light sensor 3 to be less than 25. Then, the program will reverse motor B for 3 seconds and then all motors stop.

Important:  Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program H

This program will wait for 4 seconds and run motor B. Then, it will wait for a decrease of 20 in light sensor 3, and then reverse motor B and run motor A for 1 second.

Important:  Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Program I

This program will run motor A for 3 seconds, and then wait for touch sensor 2 to be pushed.  Then, it will reverse motor A.  Then it will wait for touch sensor 2 to be released, and continually run this set of operations by jumping to the beginning of the program.

Important:  Touch sensor 1 means the input modifier (found in the modifiers section of the function palette) for the sensor is Port 1

Return to Table of Contents