NXT-G Robot Programming: Basic Line FollowingLegoMINDSTORMS NXTBasic Line Follow Step By Step DirectionsLine followingworks by using the Light Sensor to read the changes in reflected lightlevel along the edge of a dark and light surface. Then theSwitch Block directs the motors to vary the speeds depending on theLight Sensor Value.In a Basic Line Follow the Light Sensor reads the light value. Ifthe value reads darker than a set value the left wheel spins and theright wheel stops. If the value reads lighter than the set valuethe right wheel spins and the left wheel stops.The pseudo code for Basic Line Follow Reads as:Loop(forever)if LightValue 40RightMotor Power = 40LeftMotor Power = 0RobotProject 1b: Basic Line FollowObjectives:Use Conditional Switch Block to evaluate Input Values of Light SensorUse Loop Block to Repeat Switch BlockProject:Write an NXT-G program that will have your robot follow a line using asimple Algorithm.Process:1.
![]()
Open the Mindstorms NXT-G software. (Double click theorange square icon.)2. Name your program 'LastnameBasicLineFollow' and Click 'GO.' Drag a Switch Block to the Programming Area.a. Set the Sensor to 'Light Sensor'b. Set the Compare to Save)15.
Download and test with the Robot.Notes:A. You will need to work with the Light Value Numbers and MotorSpeeds to 'tune' the line follow to track the line depending on lightconditions and path of line.
![]()
A lower motor speed will allow therobot to track a 'more curvy' line.B. This program will track the Right Hand side of the line.How can you change the program to track the Left Hand side of the line?C. The robot makes a wiggly track to follow the line. Howcan you modify the program to allow for more efficient motion with theRobot.
EV3RSTORM is the most advanced of the LEGO® MINDSTORMS® robots. Equipped with a blasting bazooka and a spinning tri-blade, EV3RSTORM is superior in both intelligence as well as in fighting power. Control EV3RSTORM with your smartphone or tablet by downloading the free LEGO® MINDSTORMS® Robot Commander app from your app store.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |