Anda di halaman 1dari 4

10/26/2016

AlternativeArduinoInterfaceslearn.sparkfun.com

AlternativeArduinoInterfaces
CONTRIBUTORS:
FAVORITE

JIMB0
7

ArduBlock
ArduBlockisaprogrammingenvironmentdesignedtomakephysicalcomputingwithArduinoaseasyasdraganddrop.Insteadofwritingcode,worryingabout
syntax,and(mis)placingsemicolons,ArduBlockallowsyoutovisuallyprogramwithansnappedtogetherlistofcodeblocks.

ArduBlockbuildsonthesimplicityofArduino,andcreatesaperfectbeginnergatewaytophysicalcomputing.Insteadoftearingyourhairoutdebugging,youcan
spendyourtimecreating!

InstallingArduBlock
ArduBlockissomethingofanaddontoArduino,soitrequiresthatyouhavetheArduinoIDEinstalled.Thebenefitofthat,though,isbecauseArduinoismulti
platformArduBlockworksonWindows,Mac,orLinux.Plus,havingArduinoalreadypresentmakesthetransitionfromvisualprogrammingtotextprogramming
easier,whentheinevitabilityapproaches.
InstallingArduBlockcanbealittletrickytheresnoinstaller,justaJavafilethatneedstobestoredinaveryspecificlocation.Followthestepsbelowtoinstallit:
1.DownloadandInstallArduino(ifyouhaventalready)ArdublockisanextensionofthedefaultArduinoIDE,soyoullneedtohaveArduinoinstalledonyour
computertorunit.CheckoutourInstallingArduinoIDEtutorialforhelpwiththat.
2.DownloadArduBlockClickthelinktotheleft,orheadovertotheArduBlockSourceforgepagetofindthelatestandgreatestversion.
3.IdentifyyourArduinoSketchbooklocationThisisafolderonyourcomputerwhereyoursketchesandlibrariesaresavedbydefault.Tofindyour
sketchbooklocation,runArduino,andopenPreferencesbygoingtoFile>Preferences.Thecontentsofthetoptextboxdefinesyoursketchbooklocation.
MemorizethatlocationandcloseArduino.

4.Create[sketchbook]/tools/ArduBlockTool/tool/TheArdublockfileyoudownloadedearlierneedstoliveinaveryspecificlocationwithinyourArduino
sketchbook.Navigatetoyoursketchbook,thencreateanestofthreedirectories:tools>ArduBlockTool>tool(watchout,eachfolderiscasesensitive).
5.Pasteardublockxxxxxxxx.jarInto/tool/PastetheArdublockfileyoudownloadedaJAR(JavaARchive)fileintothelastfolderinthenestyou
created.

https://learn.sparkfun.com/tutorials/alternativearduinointerfaces/ardublock

1/4

10/26/2016

AlternativeArduinoInterfaceslearn.sparkfun.com

6.StartArduinoOrrestartitifitwasopen.
7.SelecttheBoardandSerialPortJustasyouwouldifyouwereusingArduino,makeyourboardandserialportselectionsfromtheToolsmenu.
8.OpenArduBlockRunArduBlockbyclickingTools>ArduBlock.IfyoudontseeanentryforArduBlockhere,doublechecktomakesureyourdirectories
areallcorrectlytypedandcased.

ArduBlockworkshandinhandwiththeArduinoIDEitreliesontheIDEbeingopeninthebackground,sodontclosetheArduinowindow!

UsingArduBlock
TheArduBlockwindowissplitintotwohalves.Onthelefttherearebins,whichstoreeverypossibleblockyoucanaddtoyoursketch.Theblank,grayslatetothe
rightofthatiswhereyoudrawyoursketch.Toaddablocktoyoursketch,simplydragitfromthebinintotheblank,grayarea.
Tobegin,everyArduBlocksketchrequiresaProgramblock,whichyoucanfindintheControlbin.TheProgramblockdefinesthe setup and loop functionsthat
everyArduinoprogramrequires.

Fromthere,youcandragmoreBlocksover,snappingthemintoeitherthe loop or setup sections.Here,trymakingablinkprogram.Thesetdigitalpinblocks,


whicheffectadigitaloutput(analogoustoArduinos digitalWrite function),arefoundunderthePinsbin.Thedelaymillisecondsblock,foundunderControl,is
analogoustoa delay Arduinofunction.

https://learn.sparkfun.com/tutorials/alternativearduinointerfaces/ardublock

2/4

10/26/2016

AlternativeArduinoInterfaceslearn.sparkfun.com

ThenclickUploadtoArduinotosendyourdrawingofftoyourArduinoboard.YoucanALT+TABbackovertotheArduinowindowtocheckyourcodeuploadstatus.

Afteryouvesuccessfullyuploadedyourfirstsketch,continuetoplayaroundandexplorethecontentsoftheotherbins!

ArduBlockTips&Tricks
Youcancloneblocks,orgroupsofblocks,byrightclickingandselectingClone.Everythingfromtheblockyourightclickedtothebottomofthatgroupwillbe
copiedandpastedintothetopleftcornerofthewindow.Thisisahugetimesaverforbiggerdrawings.

YoucantemporarilyremovecodefromyoursketchbydraggingitoutoftheentiretyoftheProgramblock.AnythingnotconnectedtothemainProgramblockwill
beignoredwhenyourcodeiscompiled.Thisisagreatdebuggingtoolyoucanremoveablockofcodefromprogramexecution,whilenotactuallydeletingit,much
likecommentingoutcode.

Finally,ifyoupeekbackoverattheArduinowindow,afteryouveuploadedanArduBlockdrawing,youmaynoticesomethingdifferent.Tocreateyourcode,the
ArduBlockprogramsimplyparsesyourblocksandspitstheequivalentArduinocodeoverintotheArduinowindow.

Thisbecomesagreatlearningtoolifyoureinterestedintransitioningfromgraphicalprogrammingtotext.

ArduBlockResources
https://learn.sparkfun.com/tutorials/alternativearduinointerfaces/ardublock

3/4

10/26/2016

AlternativeArduinoInterfaceslearn.sparkfun.com

ArduBlockHomepage
ArduBlockGitHubRepository(OpenSource!)
SparkFunDigitalSandBoxExperimentGuideAseriesofArduinoexperimentsallbasedaroundArduBlock.

PREVIOUSPAGE
CODEBENDER

https://learn.sparkfun.com/tutorials/alternativearduinointerfaces/ardublock

VIEWASASINGLEPAGE

NEXTPAGE
MINIBLOQ

4/4

Anda mungkin juga menyukai