tetrix getting started guide additional guides nxt brick guide
TRANSCRIPT
326
Preparing the NXT Brick
Nowthatafunctionalprogramhasbeencreated,itmustbetransferredtotheNXTBrickandthenrun.ThisisaperfecttimetotakealookattheNXTBrickindetail.
The NXT Brick
TheNXTBrickisthebrainofaLEGO®MINDSTORMS®robot.Itboastsapowerful32-bitmicroprocessorandflashmemory.
TheNXTcanreceiveinputfromuptofoursensorsandcontroluptothreeNXTorseveralTETRIX®DCandservomotors,allviaitssevenports.ItalsohasanLCDdisplayandfourbuttons.ThebuttonsareusedtonavigatethroughtheNXTmenus.TheNXTispoweredbysixAAbatteriesorarechargeablebatterypack.
ThetwograyarrowbuttonsareusedtonavigatethroughtheNXT’smenus.Theorangebuttonisusedtoselectobjectsfromthemenu,andthedarkgrayrectanglebuttonisusedtoendaprogramornavigatetothemainmenuontheNXT.
ProgramscanbetransferredfromacomputertotheNXTusingUSBorBluetooth®.
Using a USB Cable:
IfaUSBcableisbeingusedtoconnect:
1.ConnectoneendoftheUSBcabletotheNXTBrick.
2.ConnecttheotherendoftheUSBcabletothecomputer’sUSBport.
Note: ItisimportanttobepatientastheoperatingsystemcantakeafewminutestoinstallthedriversthefirsttimeanNXTisconnectedtothecomputer,
Using Bluetooth:
IfBluetoothisbeingusedtoconnect:
1.EnsurethatBluetoothisenabledontheNXT.Todothis,turnontheNXTandselectBluetoothfromthemainmenu.
2.EnsurethatBluetoothisturnedonbyselectingtheOn/OfficonandselectingOn.OnceBluetoothisturnedon,theNXTwillreturntothemainmenuwhereBluetoothmustbeselectedagain.
3.EnsurethattheNXT’svisibilityisenabledsothatthecomputerisabletoseeit.Todothis,gointotheBluetoothmenuagain,selectVisibility,andthenselectVisible.
NXT Brick Guide
AdditionalGuidesTETRIX®GettingStartedGuide
327
Connecting to the NXT using ROBOTC®
GotoLink SetupunderNXT BrickintheRobottab.Thiswillopenawindowsimilartotheoneshownbelow.
a.UsingUSBwithROBOTC
1.IftheNXTisalreadyconnectedviaUSB,itwillbelistedunderNXT Bricks Currently Connected via USB.
2.ClickitoncetohighlightitandclicktheSelectbuttontolinkittoROBOTC.
3.ClickClosetoclosethewindow.
b.UsingBluetooth®withROBOTC
1.IfBluetoothisbeingusedandtheNXTdoesnotshowupintheboxbelowNXTBricksReachableviaBluetoothWireless,selectInclude Bluetooth intheBrick SearchoptionandclicktheRefresh Listsbutton.
2.OncetheNXTisvisible,clickitoncetohighlightitandclicktheSelect via BTbuttontolinkittoROBOTC.ApromptwillappeartoenterapasskeyintotheNXTBrick.Thedefaultshouldbe1234.Ifitisnot,usethegreyarrowkeysandtheorangeselectbuttonontheNXTBricktoenterit.Selectthecheckmarktoselectthepasskey.
3.NowclicktheClosebuttononthecomputertoclosethewindow.
OncetheNXTisconnected,programscanbedownloadedbyselectingCompile and Download ProgramundertheRobottaborbypressingF5.
Toruntheprogram,selectStartintheProgram DebugwindowthatappearsinROBOTCorfindthefileontheNXTandselectRun.
TheNXThasnowbeensuccessfullyconnectedtothecomputerandprogramshavebeendownloadedandrun.
NXT Brick Guide
TETRIX®GettingStartedGuideAdditionalGuides
328
Connecting to the NXT using LabVIEW™ for LEGO® MINDSTORMS®
TellLabVIEWforLEGOMINDSTORMShowtofindtheNXT.
Using a USB with LabVIEW
1.IfaUSBcableisbeingused,clicktheConnect to an NXTdrop-downmenuontheRobot Project CenterwindowandclickFind NXT.
Note:BecausetheNXTisalreadyconnectedviaUSB,itwillbelisted.ClickitoncetohighlightitandclickConnecttolinkittoLabVIEW.
2.Thewindowisupdatedtoshowthename,batterylevel,andotherinformationaboutthebrickthatisconnected.
Using Bluetooth® with LabVIEW for LEGO MINDSTORMS
Note: ToconnecttotheNXTviaBluetooth,ensurethateitherthecomputerhasbuilt-inBluetoothcapabilitiesorthataUSBBluetoothadapterhasbeeninstalled.EnableBluetoothfromacomputeroraBluetoothadapter.
NXT Brick Guide
AdditionalGuidesTETRIX®GettingStartedGuide
329
NowthatBluetooth®isactiveonthecomputerandtheNXT,connecttotheNXTviaBluetooth®.
1.ToconnecttotheNXT,clicktheConnect to an NXTdrop-downmenuontheRobot Project CenterwindowandclickFind NXT.
2.ClickScantosearchforBluetoothdevicesandnoticethatLabVIEWforLEGO®MINDSTORMS®issearchingforBluetoothdevices.
3.Afterabout10-15seconds,theNXTwillbefound.
4.ClickonceonthenameoftheNXTtohighlightitandthenclickConnect.
Note: IfthisisthefirsttimethisNXTisconnectingtoacomputer,apromptwillappeartoenterapasskeybeforetheNXTcanpairwiththecomputer.
5.Enter“1234”asthepasskeyandselectOK.AbeepwillbeheardandapromptwillappearontheNXTBricktoenteraPIN.Select“1234”bynavigatingrightandleftwiththegrayarrowbuttonsonthebrickandselectingwiththeorangebutton.
6.Once“1234”hasbeenentered,navigatetothecheckmarkiconandpresstheorangebutton.
7.Oncethisiscomplete,theoperatingsystemwilltakeafewmomentstoformaconnectiontotheNXTviaBluetooth®.ItwillnowbepossibletowirelesslycompileprogramsontotheNXT.
Note: ManyotheroptionsoftheNXTcanbeexploredusingLabVIEWforLEGOMINDSTORMSviatheNXTTerminal.
NXT Brick Guide
TETRIX®GettingStartedGuideAdditionalGuides
330
The NXT Terminal
AccesstheNXTTerminalbyselectingNXT TerminalfromtheToolsmenuandthenselectingNXT Terminal.
IftherearemultipleNXTsconnected,selectwhichonetocommunicatewithbyusingthedrop-downmenu.Thiswindowshows:
•ThebatteryleveloftheNXT•Theamountoffreespaceinitsmemory•Itsfirmwareversion
Note:ThefirsttimeanNXTBrickisrunwithLabVIEW™forLEGO®MINDSTORMS®,makesuretoupdatethefirmwarebyclickingUpdate Firmware.ThisshouldonlybedonewhenconnectedviaUSB.
•Atthebottomofthiswindow,theFileOperationswillbevisible.AllofthefilescurrentlyontheNXTwillappear.ItisagoodideatodeleteanyoldprogramsfromtheNXTthatwillnotbeusedanymore.Allofthesoftwarefilesarein“.rxe”format.ClickthefileoncetohighlightitandthenclicktheDelete File(s) buttontoremoveit.
•TheDefragmentbuttoncanalsobeclickedtoclearupsomememory.
NowprogramscanberunontheNXT.LookattheLabVIEWtoolbar.Noticethattherearethreebuttonstorunaprogram,eachofwhichrunstheprogramslightlydifferently.ThesethreebuttonsareRun,Deploy,andDebug.
•TheRunbuttoncompilestheprogramontotheNXTandimmediatelyrunsit.Ifthisisdonewiththecodecreatedinthelessontomaketherobotmoveforward,LabVIEWforLEGOMINDSTORMScompilesthesoftwareontotheNXTandtherobotimmediatelymovesforward.
•TheDeploybuttoncompilesanddownloadstheprogramontotheNXTbutdoesnotrunituntilthebuttonsontheNXTBrickhavebeenusedtochooseit.ThisisveryhelpfulwhencompilingprogramsusingUSBwithoutrunningtheprogramimmediately.Forexample,iftheprograminvolvestherobotmoving,theRun buttonwillcompileandruntheprogram,causingtherobottostartmovingwiththeUSBcablestillattached.TheDeploybuttonwillonlycompiletheprogram.TheUSBcablemustberemovedtorunit.
•ThethirdmethodforrunningaprogramistheDebug option.Essentially,DebugkeepsthelinkbetweentheLabVIEWprogramonthecomputerandtheNXTBrick.Usethistodebugtheprogramandinterrogateittomakesureitisworkingproperly.
SelecteithertheRunbuttonortheDeploybutton.Arobotprogramhasnowbeencreatedanddeployed.
NXT Brick Guide
AdditionalGuidesTETRIX®GettingStartedGuide