Method 1: Steering in the Move block The Mindstorms NXT software provides a Move block which allows you to specify the amount of Steering in the form of an amount that varries between -100 and +100. Programs with 'Calibrated' light sensors may work in different environments and under different conditions without modification-all that needs to be done is to re-calibrate the sensors. Some programs may work better with un-calibrated sensors-especially those that pass values directly to the steering option of the Move block. The are practical advantages and disadvantages to each.
Principle: If the robot has only one light sensor, the line following program will instruct the robot to follow only one side of the line (left or right depending on the formulas used in the program and the orientation of the motors in the robot design).For NXT, many of the programs below use either ' or ' light sensors. This is a perfect example of a simple drive code. This image simply shows the above program converted to text using RobotC's.
The first code shows how to make a motor move to a specific location, using RUp and RDown (lines 11-19).
The <> symbol in the top left of the screen indicates that your NXT’s are connected. ROBOTC is a Cbased programming language that is used to create and execute programs for VEX and Lego. They are intentionally posted as images in order to allow you the joy of typing each character, and learning something in the process.Choose the NXT that you want to connect to. Variable Types Data Type Description Example Code Integer Positive and negative whole numbers, -35, -1, 0, as well as zero 33, 100 Floating Point Number Numeric values with decimal points (even if the decimal part is zero). Several of the various programs are discussed and illustrated below. Connect the NXT’s using the menu on the NXT brick: (Only the first time) Go to Bluetooth > Search. In this post, Toptal Engineer Nick McCrea provides a step-by-step, easy-to-follow tutorial (with code samples) that walks you through the process of building a basic autonomous mobile robot.