You are on page 1of 118

FLL Advanced Programming

& Best Practices Workshop


Bill Aucoin
Maryland State FLL Committee
University of Maryland, Baltimore
County (UMBC)
October 5, 2013

Guidelines For Today


Feel free to enter and leave at any time quietly
The toilets are out the back of the auditorium and to the right
This is intended to be a facilitated discussion, not a one-way lecture
Group participation is expected at all times!

This discussion is intended to stand alone


We apologize if some of the topics you have heard already

The target audience is all types of coaches: rookie to expert


We will avoid specific discussions of this years challenge and
strategies for each mission
Feel free to discuss that outside of this clinic

v3.0

Introductions and
Administrivia

Dont Be Worried If You Feel That You Dont


Know Everything About FLL and Robotics!
http://www.firstlegoleague.org/mission/corevalues

We are a team.
We do the work to find solutions with guidance from our coaches and
mentors.
We know our coaches and mentors don't have all the answers; we
learn together.
We honor the spirit of friendly competition.
What we discover is more important than what we win.
We share our experiences with others.
We display Gracious Professionalism and Coopertition in everything
we do.
We have FUN!
v3.0

In The Spirit Of Coopertition , Please Consider


Helping Other Teams
http://www.usfirst.org/aboutus/gracious-professionalism

Coopertition is displaying unqualified kindness and


respect in the face of fierce competition
Coopertition is founded on the concept and a
philosophy that teams can and should help and
cooperate with each other even as they compete
Coopertition involves learning from teammates
It is teaching teammates
It is learning from mentors
And it is managing and being managed

Coopertition means competing always, but


assisting and enabling others when you can

v3.0

If You Are A Beginning Team, Be Comfortable


With How Far You Team Can Go
http://www.firstlegoleague.org/mission/corevalues

We are a team.
The topics we discuss today might be
We
do the work
findare
solutions
something
thingtoyou
alreadywith
doing,
guidance
from you
our coaches
andyear,
mentors.
something
can do this
or
something you should try next year
We know our coaches and mentors don't
have all the answers; we learn together.

Regional Qualifier !

State Tournament !!

You make the choice!

We honor the spirit of friendly competition.


What we discover is more important than
what we win.
We share our experiences with others.

World Festival !!!

We display Gracious Professionalism and


Coopertition in everything we do.
9

We have FUN!

v3.0

It Is Up To The Individual Coaches On How To


Teach/Apply These Ideas With Their Teams

Please try to make FLL


a learning experience
for your teams!

10

v3.0

Agenda
Start

End

1:00 PM

3:00 PM

3:00 PM

???

Topic
FLL Advanced Programming and Best Practices
Open Questions and Answers

Topics
Sensors
(including Wait For Blocks and Sensor Calibration)

Squaring Up

Program Flow Control


(including Loops and Switch Blocks)

Commenting and Printing Your Programs

MyBlocks

Master Programs or Sequencers

Moving and Turning


(including Motor Blocks and Move Blocks)

Base Operations
(including Starting Positions and Attachments)

Motor Reset Blocks


Multiple Sequence Beams
Data Wires
(including Constants, Variables)

Generic Tips and Recommendations

Line Following

Other References (Books, Websites, etc.)


v3.0

Sensors
(including Wait For Blocks
and Sensor Calibration)

Cougar Robotics Has Offered What They Consider


To Be A Better Way To Wait For Sensor
http://www.cougarrobot.com

04 WaitForDark.rbt
Author: RobotBillMD
Revision: 03
Required Sensors:
Port 3 - Light Sensor
This program drives forward until it detects a black line.

05-WaitForDark.rbt
Author: RobotBillMD
Revision: 05
Required Sensors:
Port 3 - Light Sensor
This program drives forward until it detects a black line. It checks for the
line continually (every 6 degrees) vs. continuously.
Credits: This program is adapted from the program provided by Cougar
Robotics
http://www.cougarrobot.com/index.php?option=com_content&view=categor
y&layout=blog&id=78&Itemid=118

Give these a try to see which of


these programming styles work
better for you
13

v3.0

Wait For NXT Buttons: Can Be Used For Operator


Interaction

v3.0

Back To Agenda

Program Flow Control


(including Loops and
Switch Blocks)

Repeated Code Execution


Loop Blocks

Loop Block: Commonly Used When Executing


Portions Of Code When Waiting For A Condition

v3.0

Loop Block: The Loop Will Run Continuously Until


The Selected Condition Is Met

v3.0

Here Is A Way To Ramp Up Your Speed

Use the value of the loop


counter to control the
motor power

20

v3.0

Conditional Program
Execution
Switch Blocks

Switch Block: Executes Different Sequence Beams


Depending On A Condition/Sensor

v3.0

You Can Nest Switch Blocks For Extra Logic

23

v3.0

You Can Use Data Wires And Values To Control


The Switch Block

Note: This would NOT work


since I never connected the
sensor to the switch block! Oops

Three Values and the default


condition is 2 (value = 20)

Add or remove conditions


Set default button
Flat view turned off
24

v3.0

Back To Agenda

MyBlocks

My Blocks Can Be Used To Combine Common


Sections Of Code Which Is Repeated

v3.0

One Of The Best References On My Blocks Is


Online at www.NXTprograms.com
http://www.nxtprograms.com/help/MyBlocks/tutorial.html?r44b=no

28

v3.0

Ensure You Know The Issues Associated With


MyBlocks When Using Them
When you edit a MyBlock, you can affect every program that uses
that MyBlock
You need to re-download each program that uses the MyBlock to the robot
to ensure each program is refreshed
Downloading the MyBlock does not update the robot

Deleting or renaming a MyBlock will break any program that uses


the MyBlock
You need to edit each program that uses the MyBlock with the newly
renamed Block

A program and all of the MyBlocks it uses share the same list of
variables
Only one copy of a specific MyBlock can run at the same time
If you need to run the same MyBlock concurrently, copy the MyBlock and
give it a different name
29

v3.0

MyBlocks Are Stored In Their Own Folder

Moving a file to a different folder with break any program that is


using that block
Use Pack and Go to transfer programs

30

v3.0

MyBlocks Can Be Broken

A MyBlock will be broken if it has two data plugs with the same
name
A MyBlock will be broken if it uses data wires and there is a problem
with the data wire connections

31

v3.0

Back To Agenda

Moving and Turning


(including Motor Blocks
and Move Blocks)

Differences Between Move and Motor Blocks

Move Block

Motor Block

Number of motors
controlled

1, 2 or 3

Only 1 motor per block

Motor Synchronization?

Synchronization & Steering *

Block to Block Error


Correction?

Block to Block Error Correction

Block to Block Error Correction

None

If selected, power control will


increase/decrease power to
maintain desired motor rotation

None

Ramp Up
Ramp Down Only if the duration is
degrees or rotations
Constant

Motor Power Control?

Motor Action

* If you choose to control two motors (Example: B & C), the motors will be synchronized
* If you select three motors, motors B & C will be synchronized
34

v3.0

For More Reliable Movements, Use Either Locked-Wheel Turns or


Move Blocks With -100,0 or +100 Steering Commands

Recommendations

Tip

Based on this battery-voltage


experiment, we came up with the
following recommendation for FLL
teams when using NXT Software
to program their LEGO NXT
robots:
Whenever you use the MOVE
block to control your robot, ensure
both drive motors maintain the
same power level (e.g. only use
steering values of -100, 0, or
+100).

35

http://paris.utdallas.edu/IEEE-RS-ATR/document/2009/2009-15.pdf
http://www.ieeereliability.com/Newsletter/1_2010/Article1.htm

v3.0

Basic Robot
Maneuverability
Move Blocks and
Motor Blocks

Differences Between Move and Motor Blocks

Move Block

Motor Block

Number of motors
controlled

1, 2 or 3

Only 1 motor per block

Motor Synchronization?

Synchronization & Steering *

Block to Block Error


Correction?

Block to Block Error Correction

Block to Block Error Correction

None

If selected, power control will


increase/decrease power to
maintain desired motor rotation

None

Ramp Up
Ramp Down Only if the duration is
degrees or rotations
Constant

Motor Power Control?

Motor Action

* If you choose to control two motors (Example: B & C), the motors will be synchronized
* If you select three motors, motors B & C will be synchronized
41

v3.0

Carnegie Mellon University Provides A Summary


Of The Advantages & Disadvantages Of Each
http://www.education.rec.ri.cmu.edu/downloads/lego/resources/nxt/pdf/Motor
%20vs.%20Move%20Blocks.pdf

42

v3.0

Other Move and Motor Block Considerations

Motor Blocks with its Next Action Parameter set to Constant will
apply the specified power level throughout the motion of the motor
A Move Block will decrease the power near the end of the motion
(so it does not overshoot the requested duration)
A move block is similar to a Constant Motor Block for most of the duration
followed by a Ramp Down Motor Block in this sense

43

v3.0

Basic Robot
Maneuverability
Driving Straight

What Are Some Considerations For


Making The Robot Move Straight?
Matched wheels
Same diameter?
How To Make Your FLL Robot Go Straight on YouTube
TheFLLCoach (Vienna Robotics)
http://www.youtube.com/watch?NR=1&v=OlAO9Ho-N58

Matched motors
http://www.techbrick.com/Lego/TechBrick/TechTips/NXTCalibration/index.htm

Programming
Move vs. motor blocks

Wheel slippage
Friction control
Programming correct/varying power levels

Using external items


45

Line following with a sensor


Wall following by running along wall

v3.0

Sometimes Features Are Used To Ride Along The


Table Wall
Picture courtesy of Marco Ciavolino

Be careful of the
mounting location(s),
because the robot might
have a difficult time
maneuvering away from
the wall

46

v3.0

Basic Robot
Maneuverability
Robot Turns

For More Reliable Movements, Use Either Locked-Wheel Turns or


Move Blocks With -100,0 or +100 Steering Commands
http://paris.utdallas.edu/IEEE-RS-ATR/document/2009/2009-15.pdf
http://www.ieeereliability.com/Newsletter/1_2010/Article1.htm
Recommendations
Based on this battery-voltage
experiment, we came up with the
following recommendation for FLL
teams when using NXT Software
to program their LEGO NXT
robots:
Whenever you use the MOVE
block to control your robot, ensure
both drive motors maintain the
same power level (e.g. only use
steering values of -100, 0, or
+100).

Tip
48

Experiment with different types of turns and


see which one is more reliable for you!

v3.0

Basic Robot
Maneuverability
am I there yet?

Smooth Running by Dave Parker


http://forums.usfirst.org/showpost.php?p=53233&postcount=7

50

v3.0

Basic Robot
Maneuverability
Navigation

Where Possible, You Should Sense Your Outside


Environment For Navigation
Dead Reckoning Maneuvering without using sensors to determine
where you are relative to the positions of the mission models
Fix Using sensors to determine your position relative to the mat
and mission models by sensing the outside environment
Good - Motion with Move/Motor Blocks using time (seconds)

Sensitive to starting position


Sensitive to starting orientation
Sensitive to battery voltage

Better - Motion with Move/Motor Blocks using internal sensors


(rotation or degrees)
Sensitive to starting position
Sensitive to starting orientation

Best - Motion with Move/Motor Blocks while sensing or contacting

52

the external environment (light, color, touch, ultrasonic, wall,


mission model, strategic object)
Relatively insensitive to starting position and orientation
Sensitive to sensor performance and environment

v3.0

How Accurately You Need To Navigate Depends


On What Part Of The Mission You Are Executing
Initial Guidance
When leaving the base, sometimes you can be pretty
loose with your navigation accuracy

Midterm Guidance
While approaching the mission models, you should
tighten up your navigation accuracy

Terminal Guidance
At the very end of your maneuvering, you must ensure
the accuracy and precision of your navigation are
sufficient to get the job done

Some of the better teams can program some of their missions such that
they can loosely place the robot in the base and have the robot figure
out where it is and where it needs to be after leaving base
53

v3.0

If Your Robot Needs Accurate Alignment In The


Base, Consider An Alignment Fixture
Picture courtesy of Marco Ciavolino

The attachment needs to be


made out of LEGO-manufactured
pieces [Rule 4]

The team member must not be


touching the alignment fixture
when the robot leaves base
[Rule 16]

54

v3.0

Back To Agenda

Motor Reset Blocks

Basic Robot
Maneuverability
Motor Reset Blocks

Move Block Error Correction and Motor Reset


Blocks Going 8 Rotations With A Final Brake
With one move block, the motors
will go exactly 8 rotations

8.0

2.2

2.3

2.1

1.4

8.0

2.2

2.3

2.1

2.0

8.6
Notes: The last move block in each sequence above uses
brake, all of the others coast.
58

v3.0

What Are These Motor Reset Blocks Actually


Doing?
Both move and motor blocks will keep track of, and try to correct for,
accumulated errors in the motors
These errors are typically very small when the motor and move blocks include a
brake
When the coast option is used, these errors can build up

Setting direction to stop does not appear to reset accumulated move or


motor errors
This might be an error in the NXT-G help
It is never necessary to use motor reset blocks at the beginning of a
program
All motors are automatically reset at the beginning of a program

Motor reset blocks might be helpful at the beginning of code packaged in


myblocks
It depends on what the motors are doing prior to and at the beginning of the myblock
59

v3.0

The Bottom Line:


Experts Recommendation On Motor Reset Blocks
For most FLL teams, motor reset blocks are not relevant and you never really need
them
If you use brake for all of your movements, as many FLL teams do, accumulated errors are small
Its coasting that causes big errors to accumulate

The main good use of motor reset blocks in FLL is when teams combine more than
one outing into a single longer program (e.g. a menu or sequencer program)

In this case, it is necessary to coast the motor(s) to make it possible to adjust a motorized attachment
between outings, since the program is still running
Coasting the motors may cause large errors to accumulate (as the humans move the coasted motors
between outings) which will forwarded to the next motion, which is definitely not the desired result.
In a sequencer, each outing should begin with a Red Reset and end with a Coast for any relevant motors

Another possible application for the making sure a new motion starts from a fresh
measurement would be the first movement after pushing into a stationary object with
the intent to stall into it, such as having the robot push into a wall until it stalls
At this point, the rotation counts can be unpredictable (especially left to right), and you want your first
movement away from the wall to start at zero accumulated error on both sides
This is only really applicable if you drive into the wall by rotations/degrees (when seconds is really the
better choice when a stall is expected)
Many teams are likely to use degrees anyway because they dont know any better

60

v3.0

Back To Agenda

Multiple Sequence
Beams

You Can Use Multiple Sequence Beams For


Concurrent Robot Operations

While Moving Forward


(move block on other
sequence beam), move
Motor A

Move Forward

Note: Can do the same thing


with a motor block in series
with a Move Block as long as
you uncheck the Wait for
Completion option
63

v3.0

Branch Sequence Beams Can Be Added In The


Middle Of The Main Sequence Beam

64

v3.0

NXT Program Flow Rules

The program runs until it reaches the end of all sequence beams or
a stop block whichever comes first
A Block can only start when there are values on all of the input data
wires
A Loop Block or Switch Block cannot start until there are values on
all of the data wires that enter the block
A data wire that starts inside a Loop Block will have a value only
when the Loop Block finishes
A data wire that starts inside a Switch Block will have a value only
when the Switch Block finishes

65

v3.0

Be Careful Of Multiple Sequence Beams


Know The Issues With Them!
Use multiple sequence beams only when you think you really need
them
Avoid busy loops where one sequence beam is hogging the CPU
Dont try to control the same motor on different sequence beams at
the same time
Be very careful about data wires going into and out of Loop Blocks
and Switch blocks
Only one copy of a particular My Block can run at a time
If the same MyBlock is on different sequence beams, it will run the first My
Block, then run the second instance once the first one completes
Copy and rename the My Block if you need to run multiple copies
concurrently

66

v3.0

Back To Agenda

Data Wires
(including Constants
and Variables

Data Wires Carry Information Between


Programming Blocks
You create a data wire by drawing it out of a blocks data hub
Nearly all of the programming blocks have data hubs and can
support data wires.
Open a blocks data hub by clicking the tab at the lower left edge of
the block after it has been placed on the work area.
The cursor will change shape when it hovers over or is near a data
plug. If you then press the mouse button and drag to the right, a
data wire will unroll that can be connected to a plug on another
blocks data hub.
To delete a data wire that stretches from left to right between two
data plugs, click on the right plug

69

v3.0

Data Wires Carry Information Between


Programming Blocks
Data wires carrying information to a block (i.e., carrying input) are
connected to the plugs on the left side of its data hub. Data wires
carrying information away from a block to another block (i.e.,
carrying output) are connected to the plugs on the right side.

70

v3.0

Data Wires Carry Information Between


Programming Blocks
You create a data wire by drawing it out of a blocks data hub
Nearly all of the programming blocks have data hubs and can
support data wires
Open a blocks data hub by clicking the tab at the lower left edge of
the block after it has been placed on the work area
The cursor will change shape when it hovers over or is near a data
plug
If you then press the mouse button and drag to the right, a data wire will
unroll that can be connected to a plug on another blocks data hub.

Deleting a data wire


To delete a data wire that stretches from left to right between two data
plugs, click on the right plug

71

v3.0

Data Wires Carry Specific Types Of Data

Each data wire carries a specific type of data between blocks. For
example, if a data wire is dragged from a logic plug on a blocks
data hub, it can only be connected to a logic plug on another blocks
data hub.
Data wires are identified with specific colors:
wires carrying number data are colored yellow
wires carrying logic (true/false) data are colored green
wires carrying text data are colored orange.

72

v3.0

Back To Agenda

Line Following
Follow The Yellow Brick
Road Black Curvy Line

2 State Line Follower Most Basic


http://www.nxtprograms.com/line_follower/steps.html

Note: For FLL, these


display blocks might be
an unnecessary waste of
the NXT memory
You will not be able to
read the display as it is
running anyway!

Question: How long will


this line follower
program follow the line?
76

v3.0

3 State Line Follower Adds Go Straight


Art of LEGO MINDSTORMS NXT-G Programming
http://www.nostarch.com/nxt-g.htm

Go straight if you are just


over the edge of the line

77

v3.0

5 State Line Follower


http://www.nxtprograms.com/line_follower/steps.html

78

v3.0

Proportional Line Follower


http://www.nxtprograms.com/line_follower/steps.html

This is getting a bit


advanced for most FLL
teams
My opinion: If the children
dont understand it, dont
use it
79

v3.0

This Line Follower Sets The B Motor Speed To A


Constant and Throttles the C Motor Speed
http://www.hightechkids.org/sites/default/files/CoachingLibrary/fllprogramming_nxtPL_v1.0.1.ppt

80

v3.0

Proportional Integral Differential (PID) Controllers Are Overkill


For Most FLL Applications (But They Show Up At The World
Festival All The Time)
http://nxt-progs.blogspot.com/2011/02/line-following-pid-controller.html

If your team members


cannot understand it,
DONT use it.

81

v3.0

There Are Even Fuzzy Logic Line Followers


http://stefans-robots.net/en/fuzzy-line-follwing-nxt-robot.php

82

v3.0

Back To Agenda

Squaring Up

You Can Set The Orientation (Heading) Of The


Robot By Backing Into The Wall Or Using Sensors
You can use either time or multiple touch sensors to back into the
wall and orient the robot perpendicular to the wall at any time
You can detect the motor stall condition to see if you are against a
hard object (e.g. the wall)
You can use light or color sensors to detect the location of a line
and orient the robot perpendicular to the line

85

v3.0

Back To Agenda

Commenting and
Printing Your Programs
What the Heck Is This
Program Telling Me?

Annotations (Comments) In The Programs Help To


Document The Program (Judges like it too!)
Tip
You can enter
comments which are
generic to the entire
program by clicking
on the start icon

v3.0

Printing Your Programs

You Can Print Directly To Your Printer Or Capture


The Printout Electronically In HTML and RTF
HTML will create both the HTML
code as well as pictures of the code
These pictures can be inserted into
most document editing programs

Rich Text Format (RTF) can be


opened with most common word
processing programs
90

v3.0

When You Print To A Rich Text Format (RTF), This


Is What You Get When You Open It In MS Word

v3.0

Printing To HTML Will Generate Images Which


Can Be Cut and Pasted Into MS PowerPoint

v3.0

Back To Agenda

Base Operations
Time in Base is Time
Not Earning Points

Back To Agenda

Master Programs
or Sequencers

A Sequencer Program Can Help With Speeding Up


Your Pitstops In Base
http://www.cougarrobot.com
00-MasterProgram.rbt
Author: RobotBillMD
Revision: 02
Required Sensors:
None (NXT Buttons Used)

Consider an initial motor reset and a final coast for


your last motor/move blocks when using sequencers

This program is used to execute a set of


three programs in rapid sequence. Prior to
each program, this master program waits for
the orange button to be pressed.
Credits: This program is adapted from the
program provided by Cougar Robotics
http://www.cougarrobot.com/index.php?optio
n=com_content&view=category&layout=blog
&id=78&Itemid=118

There are many different


ways to implement a
sequencing program
Have your team generate
their own!
97

v3.0

Back To Agenda

Other References
(Books, Websites, etc.)

The FIRST Forum Is A Good Way To Discuss And


Get UNOFFICIAL Advice On FIRST LEGO League
http://forums.usfirst.org/forumdisplay.php?f=24

10

v3.0

The MD FIRST Website Has Many Great Resources


http://www.mdfirst.org/programs/first-lego-league/fll-team-resources.html

10

v3.0

Make Sure You Sign Up For The


FLL Coaches List Service (listserv)
https://lists.umbc.edu/lists/info/FLL_Maryland_Coaches

10

v3.0

Our Own Techbrick Provides Resources That Are


Used Worldwide Thanks Marco!
http://www.techbrick.com/Lego/Lego2011/Resources/index.html

10

v3.0

Training Is Available Via Carnegie Mellon

10

LEGO, FIRST and FLL Do Not Endorse Any Specific Tutorial Software

v3.0

In Addition To All Of The Other Lists Of


Resources, Consider Some Of These
Dave Parkers Website A Frequent World Festival Judge
http://www.nxtprograms.com - Well documented NXT-G code!

NXT-G Tips & Tricks on Team Hassenplug Website and Code


Examples
http://www.teamhassenplug.org/NXT/NXTGTips/
http://www.teamhassenplug.org/NXT/NXT-GCodeIndex.html

Minnesota FLL High Tech Kids


http://www.hightechkids.org/

Northern California FLL - Playing at Learning


http://www.playingatlearning.org/NCaFLL

FLL Freak Skye Sweeny


http://www.fll-freak.com/

Cougar Robotics (former high performing FLL team)


http://www.cougarrobot.com/
10

v3.0

In Addition To All Of The Other Lists Of


Resources, Consider Some Of These (Continued)
Oregon State Robotics
http://www.ortop.org/fll/

The NXT Step


http://www.thenxtstep.blogspot.com/

10

v3.0

Telephone Support Is Available For Technical Stuff


They Dont Answer FLL-Specific Questions

LEGO Education
866-349-5346
7:30AM to 5:30PM CST
LEGO Retail
800-838-9647
7:30AM to 5:30PM CST
10

v3.0

Popular
Reference Books

Jim Kellys Book On FIRST LEGO League Has Been


Pretty Popular

This book is a bit


dated, so remember
that the official rules
take precedence

10

v3.0

Programming References In Print

11

v3.0

Additional Print References

111

v3.0

The LETS GO Boys and Girls Manual Provides A


Curriculum and Instructional Exercises For FLL

11

v3.0

The Help Provided With The NXT-G Software Is


Well Documented and Very Helpful

11

v3.0

Programming References In Print

11

v3.0

A Very Good (and Free) NXT-G and EV3 Tutorial Is


Available at STEMcentric.com
NXT Tutorial:
http://www.stemcentric.com/nxt-tutorial/

11

EV3 Tutorial
http://www.stemcentric.com/ev3-tutorial/

LEGO, FIRST and FLL Do Not Endorse Any Specific Tutorial Software

v3.0

Training Is Available Via Carnegie Mellon

11

LEGO, FIRST and FLL Do Not Endorse Any Specific Tutorial Software

v3.0

Back To Agenda

Generic Tips and


Recommendations

The NXT-G Software Has Default Ports For


Various Outputs and Sensors
While you can reprogram each port for a different device, it is easier to stay
with the default outputs and sensors for each port
Port

11

Default Usage

Notes

Motor Block and Lamp* Block

Attachment motors, if needed

Move Block

Robot mobility (left motor)

Move Block

Robot mobility (right motor)

Touch Sensor

Sound Sensor (Not Allowed In FLL)

Light Sensor

Color Sensor

Ultrasonic Sensor

v3.0

If You Have A Block That You Would Like To


Reuse, Use <Control> Mouse Drag To Replicate

For FLL, you should use port 2


for the second sensor, if you use
more than one of a certain type

Tip

B/C

12

v3.0

When Debugging Software, Here Are Some Tips


Annotate your software so you know where to make any changes
If you think you have several changes
Change only one thing at a time
Start with the changes closest to the beginning of the program

You can put sound blocks in to have the robot give you audible
signals when the robot does something
Drawback: the soundblocks will take up extra memory in the NXT

You can put breaks in the code by inserting a motor stop block
followed by a wait for block (one possible example provided below)

12

This could be made into a myblock

v3.0

Highly Recommended!
File Naming Convention and Regular Backups
Tell the team to use a standard naming convention
One I like is <Persons Initials><Short Description><Version Number>
For example: wbaPickupMeat_v2

Create an online backup of the programs every day


Create an online back up of the profile directory by just copying this folder
pasting it to the same folder:
C:\Documents and Settings\<Username>\My Documents\LEGO
Creations\MINDSTORMS Projects\Profiles\Default
I usually do not use different profile names with NXT-G; I use the default
profile for the entire team
This ensures any myblocks etc. are all shared by the team
See naming convention above to prevent overwriting myblocks

Periodically, create an offline backup by copying this folder to a USB


thumbdrive or equivalent
12

v3.0

Bluetooth Is Disallowed By FLL At The Competition


Bluetooth Can Be Used During Your Practice

Bluetooth communications are not allowed at the competitions


Tip

Bluetooth can be very helpful during practices


The NXT Brick has Bluetooth built-in
You either need a computer with built-in
Bluetooth or you need a Bluetooth dongle

v3.0

How To Connect Via Bluetooth to NXT Robots


Thanks to Andy Traiger of Vienna Robotics

12

Turn on the computer

Slide in the Bluetooth dongle (some computers do not boot with the dongle installed)

On the computer, open the Bluetooth Devices window

If any NXT device is listed in the Devices list, Remove it (otherwise, a 'Line Busy' error will pop up
later). Make sure 'Turn discovery on' is selected. Close the Bluetooth Devices window.

Switch on the NXT, and select 'Search' from the Bluetooth menu, then 'Connect' to the found
computer. Accept the passcode [1234].

On the PC, a window comes up mentioning that a Bluetooth device is requesting to connect,
asking if you want to allow connection. Click on the message to allow connection. A new window
pops up, asking for the passcode. Type in the passcode and click Next. Again, the NXT beeps to
verify the passcode; press the orange button on NXT to accept.

Open the Bluetooth Devices window. Select the NXT device and press 'Properties'. In the new
window that opens, click the 'Services' tab. Now, Windows starts searching for services that NXT
supports. Select all available services (in my case, two serial ports) and press OK. Windows now
installs some new drivers. After that, close the Bluetooth Devices window.

Now, start the Mindstorms software on the PC, and open the NXT window. Scan for NXT devices,
and after finding NXT, click "Connect" (if not already connected during scanning).
v3.0

Back To Agenda

Here Is A Way To Detect How Many Touch


Sensors Are Pressed

Connect all of the touch sensors together using RCX to NXT


conversion wires and plug them into one port
Please give RobotBill credit for this within the comments of your
program if you use this technique
126

v3.0

You might also like