Académique Documents
Professionnel Documents
Culture Documents
MotorBlock
Thisweekinmyroboticsclass,wehadourfirstintroductionstoprogrammingourrobotstodo
certainthingsorforthingstohappenasaresultofsomethingelse.Ourgoalwas
10ftx12in=120in
Circumpherenceoftires:6.91in/rotation
DistancefromFrontSensortoWheels:3.45in
120in3.45in=116.55in
116.55in/6.91in/rotation=16.867rotations
Thisisourbasicmotorblock.Itcontrolsthe
motorsinportsB&C.
Thisboxis
theattributesboxwhichallowsustocustomizeourroboticsmotorstodowhatweneedittodo.
Thedurationwillbethefocusofournextactivity.
ThiswasthefinalcustomizationofthemotorblockIusedtoachievethisgoal.
UltrasonicSensor
InthischallengewehadtouseourUltrasonicsensoratthetopofourNXTrobottoallowthe
robottoknowwhentostopinsteadofrunintoawall.
Thiswasthelayoutofprogrambricksusedtocompletethischallenge.
Firstwasamotionblockthathadourrobotkeepmovingforeverunlesssomethingeffectedit.
Nextisthewaitblockthathadourultrasonicsensordetectsomethingandcauseanactionwhen
itdetectssomethinglessthan23centimetersaway.
Thefinalblockwasamotionblockthathadourrobotbrakewhentheultrasonicsensordetect
somethinglessthan23centimetersaway.
Calculations:
Distancefromcentertofrontofrobot:7.5in=28cm
Usethisnumbertodeterminehowfarofadistancefromanobjectwhereyourrobotshouldstop
orcarryoutsomeotherfunction.
SoundSensor:
Thechallengeofthesoundsensorwastoprogramourrobottostoporreversedirectionsfrom
thesoundofourvoice.Enterthesoundsensor!Wecanprogramthesoundsensortohaveour
robotcarryoutanactionwhentheitdetectssoundatacertaindecibellevel.
Thiswasthelayoutoftheprogramblocksforthisprogram.Amotionblock,awaitSound
sensorblock,andafinalmotionblock.
Thefirstmotionblockhastherobotmovingforwardforeverandhavingthewheelsneverstop.
Thewaitblockissettohavetherobotaccomplishitsnextactionwhenthesoundsensordetectsa
noisegreaterthan65decibels.
Thefinalmotionblockhasourrobotreversingdirectionandmovingforward5rotationstoshow
thatoursoundsensordetectedthesound.
TouchSensor:
Thechallengewehavebeenassignedforourtouchsensoristohaveourrobotswitchfromgoing
backwardstogoingforwardnormallywhenthetouchsensoronthebackisbumped.
Theprogramblocklayoutforthetouchsensorprogramisabove:1motionblock,1waitblock
settothetouchsensor,and1moremotionblock
Thefirstmotionhastherobotgoingbackwardsforeverwithanunlimiteddurationsoitwill
neverstopunlessprogrammedbyfollowingblockstochange.
Thewaitblockisprogrammedtothetouchsensortocarryoutthefollowingactionwhenthe
sensorisbumped(pressedandreleased).
Thefinalmotionblockhastherobotswitchingdirectionandgoingforwardfor5rotationsin
ordertoshowthatthesensorwaspressedandtherobotprogrammedcorrectly.
LightSensor:
Thelightsensorisusedtodeterminetheaverageamountoflightitprojectthatreflectsoffthe
surfacetherobotismovingon.
Onagraysurfacemyrobotwasplacedon,47%ofthelightthatwasprojectedreflectedoffthe
surfaceandonawhitesurface,75%ofthelightwasreflected.
ParallelProcessing:
ParallelprocessingisthesimultaneoususeofmorethanoneCPUorprocessorcoretoexecutea
programormultiplecomputationalthreads.
Thisallowstherobottobeabletoprocessmultiplethingswhenitgetsindifferentscenariosor
environments.