IntelGalileoEssentials
TableofContents
IntelGalileoEssentials
Credits
AbouttheAuthor
AbouttheReviewers
www.PacktPub.com
Supportfiles,eBooks,discountoffers,andmore
Whysubscribe?
FreeaccessforPacktaccountholders
Preface
Whatthisbookcovers
Whatyouneedforthisbook
Whothisbookisfor
Conventions
Readerfeedback
Customersupport
Downloadingthecolorimagesofthisbook
Errata
Piracy
Questions
1.GettingStartedwiththeGalileo
UnpackingandconnectingtheGalileo
DownloadingthesoftwareandconnectingtheGalileotoaWindowsmachine
DownloadingthesoftwareandconnectingtheGalileotoaMac
DownloadingthesoftwareandconnectingtheGalileotoaLinuxmachine
RunningtheIDEfortheGalileo
SettingtheIDEtoconnecttoyourboard
SelectingtheproperCOMportforWindows
SelectingtheproperCOMportfortheMac
SelectingtheproperCOMportforaLinuxMachine
Updatingthefirmware
OpeninganduploadingafiletotheGalileo
AccessingtheGalileo’sLinuxcapabilities
Summary
2.AccessingtheGPIOPins
TheGPIOcapabilityoftheGalileo
UsingtheGPIOpins
Connectingyourfirstexternalhardware
Pluggingyourwiresintothebreadboard
Settinguptheelectronics
TheIDEandLEDCode
Gettingsignalsfromtheoutsideworld
InterfacingdigitalinputsignalswithGalileo
InterfacinganaloginputsignalswithGalileo
Summary
3.AddingDisplayFunctionality
Thesimpleserialdisplay
EnablingtheserialdisplayintheIDE
TheTFTshield
AccessingthedisplaywiththeIDE
Summary
4.ControllingDCMotors
DCmotorbasics
ConnectingaDCmotordirectlytotheGalileo
GalileocodeforDCmotorspeedcontrol
ConnectingaDCmotorusinganH-bridgeandtheGalileo
GalileocodeforDCmotordirectioncontrol
ControllingDCmotorsusingashield
GalileocodefortheDCmotorshield
Summary
5.AddingSensors
Sensingdistance
TheInfraredsensor
ConnectinganIRsensortotheGalileo
AccessingtheIRsensorfromtheGalileoIDE
ConnectingadigitalcompasstotheGalileo
AccessingthecompassfromtheIDE
ConnectinganaccelerometerorgyrototheGalileo
AccessingtheaccelerometerfromtheIDE
Connectinganaltimeter/pressuresensortotheGalileo
Accessingthealtimeter/pressureSensorfromtheGalileoIDE
Summary
6.RemoteControl
ConnectinganXBeeinterfacetotheGalileo
ConfiguringtheXBeedevices
EnablinganXBeeInterfaceintheIDE
ConfiguringaWi-FiconnectionontheGalileo
UsingWi-FifromtheIDE
Summary
7.GoingFurtherwithGalileo
TheGalileoandLinux
CreatingandbootingtheDebianLinuxSDcardimageontheGalileo
Buildingrobotsthatcanwalk
Howservomotorswork
Buildingthequadrupedplatform
Usingaservocontrollertocontroltheservos
CommunicatingwiththeservocontrollerviaaPC
ConnectingtheservocontrollertotheGalileo
CreatingaprograminLinuxsothatyoucancontrolyourquadruped
Summary
8.SpeechOutput
Hookingupthehardwaretomakeaninputsound
Usinganapplication
UsingEspeaktoallowourprojectstorespondinarobotvoice
Summary
Index
IntelGalileoEssentials
IntelGalileoEssentials
Copyright©2015PacktPublishing
Allrightsreserved.Nopartofthisbookmaybereproduced,storedinaretrievalsystem,
ortransmittedinanyformorbyanymeans,withoutthepriorwrittenpermissionofthe
publisher,exceptinthecaseofbriefquotationsembeddedincriticalarticlesorreviews.
Everyefforthasbeenmadeinthepreparationofthisbooktoensuretheaccuracyofthe
informationpresented.However,theinformationcontainedinthisbookissoldwithout
warranty,eitherexpressorimplied.Neithertheauthor,norPacktPublishing,andits
dealersanddistributorswillbeheldliableforanydamagescausedorallegedtobecaused
directlyorindirectlybythisbook.
PacktPublishinghasendeavoredtoprovidetrademarkinformationaboutallofthe
companiesandproductsmentionedinthisbookbytheappropriateuseofcapitals.
However,PacktPublishingcannotguaranteetheaccuracyofthisinformation.
Firstpublished:February2015
Productionreference:1180215
PublishedbyPacktPublishingLtd.
LiveryPlace
35LiveryStreet
BirminghamB32PB,UK.
ISBN978-1-78439-890-3
www.packtpub.com
Credits
Author
RichardGrimmett
Reviewers
AustinHughes
AlanPlotko
JasonWright
CommissioningEditor
AshwinNair
AcquisitionEditor
SamWood
ContentDevelopmentEditor
MohammedFahad
TechnicalEditor
NaveenkumarJain
CopyEditors
NehaKarnani
MerilynPereira
ProjectCoordinator
PuravMotiwalla
Proofreaders
StephenCopestake
PaulHindle
Indexer
RekhaNair
ProductionCoordinator
ShantanuN.Zagade
CoverWork
ShantanuN.Zagade
AbouttheAuthor
RichardGrimmetthasalwaysbeenfascinatedbycomputersandelectronicsfromhis
veryfirstprogrammingprojectthatusedFortranonpunchcards.Hehasabachelor’sand
master’sdegreeinelectricalengineeringandaPhDinleadershipstudies.Healsohas26
yearsofexperienceinelectronicsandcomputers.Hepossessesoneoftheoriginalbrick
phonesaswellasaGoogleglass.Henowteachescomputerscienceandelectrical
engineeringatBrighamYoungUniversity-Idaho,wherehisofficeisfilledwithhismany
roboticsprojects.
Iwouldcertainlyliketothankmywife,Jeanne,andfamilyforprovidingmewitha
wonderful,supportiveenvironmentthatencouragesmetotakeonprojectslikethis.I
wouldalsoliketothankmystudents;theyshowmethatamazingthingscanbe
accomplishedbythosewhoareunawareofthebarriers.
AbouttheReviewers
AustinHughesisasoftwareengineerwithaninterestinmicrocontrollers,embedded
systems,androbotics.
AlanPlotkoisatechnologyenthusiastwithexperienceindevelopingacrossthefull
stack.Hewasfirstexposedtoprogrammingattheageof9whenhediscoveredtheview
sourcecodeoptioninhisbrowser.Codingthenquicklyturnedintoahobby;thisledtohis
studyingcomputerscienceattheuniversitylevel.Alanlovesdevelopingapplicationsfor
theWebandalwaysmakestimetoattendhackathons,whicharetypicallyweekend-long
programmingcompetitionswhereparticipantsbuildprojectsfromscratchtobenefitthe
community.Alan’sexperienceextendstoPythondevelopment,variousdatabase
technologies,includingNoSQL,andframeworksforrapidapplicationdevelopment.
Whenhe’snotwritingcode,Alanspendshistimewritingstories;heisanavidwriter,
havingpreviouslyself-publishedafantasynovel.
JasonWrightisahardwareengineerinIntel’sNewDevicesGroup,whereheworkson
projectsintheareaoflow-powerembeddedandwearablecomputing.Previously,he
workedonGalileo-basedurbansensingdeviceswithinIntelLabsEurope.Jasonreceived
hisBSandMEngdegreesinelectricalandcomputerengineeringfromCornellUniversity
in2012and2013.
Jasonwouldliketothankhisfamilyandfriendsfortheircontinuedloveandsupport.
www.PacktPub.com
Supportfiles,eBooks,discountoffers,and
more
Forsupportfilesanddownloadsrelatedtoyourbook,pleasevisitwww.PacktPub.com.
DidyouknowthatPacktofferseBookversionsofeverybookpublished,withPDFand
ePubfilesavailable?YoucanupgradetotheeBookversionatwww.PacktPub.comandas
aprintbookcustomer,youareentitledtoadiscountontheeBookcopy.Getintouchwith
usat<>formoredetails.
Atwww.PacktPub.com,youcanalsoreadacollectionoffreetechnicalarticles,signup
forarangeoffreenewslettersandreceiveexclusivediscountsandoffersonPacktbooks
andeBooks.
/>DoyouneedinstantsolutionstoyourITquestions?PacktLibisPackt’sonlinedigital
booklibrary.Here,youcansearch,access,andreadPackt’sentirelibraryofbooks.
Whysubscribe?
FullysearchableacrosseverybookpublishedbyPackt
Copyandpaste,print,andbookmarkcontent
Ondemandandaccessibleviaawebbrowser
FreeaccessforPacktaccountholders
IfyouhaveanaccountwithPacktatwww.PacktPub.com,youcanusethistoaccess
PacktLibtodayandview9entirelyfreebooks.Simplyuseyourlogincredentialsfor
immediateaccess.
Preface
Overthelastfewyears,anumberofimportanttechnologicaltoolshavebeenintroduced
thathaveenabledthemigrationofcomplexelectronicsprojectsfromtheUniversityor
GovernmentLabtoalmostanyone’sprojectdesk.TheGalileo,aninexpensiveprocessor
systembyIntel,isanexampleofoneofthesetoolkits.Thissmall,inexpensive,but
powerfulboardcanbeusedinawiderangeofprojects.
Butjustasimportantasthehardwareisthecommunityofdeveloperswhonotonly
providehelpintheareaofsoftwaredevelopment,butalsoprovidehardwareadd-onsfor
theprocessorboarditself.Still,itcanbeabitintimidatingtostartusingGalileotobuild
yourveryownprojects.
Thisbookisdesignedtohelpanyone,eventhosewithnoprogrammingbackgroundor
experience,tobesuccessfulinbuildingbothsimplebutalsoquitecomplexprojects.It
willleadyouthroughtheprocessstepbystepsothatyourprojectdesignscancometo
life.Hopefully,thisbookwillinspirethosewiththeimaginationandcreativespiritto
buildthosewildlyinventivedesignsthatwillrevolutionizetheworld!
Whatthisbookcovers
Chapter1,GettingStartedwiththeGalileo,beginswithadiscussionofhowtoconnect
powerandendswithafullsystem,configuredandreadytobeginconnectingamazing
devicesandSWcapabilitiestofulfillalmostanyproject.
Chapter2,AccessingtheGPIOPins,showsyoutohowtoaccessthesepins,bothinput
andoutput,soyoucandoallsortsofamazingthings.Oneofthecapabilitiesyou’llneed
tocompleteyourprojectsisabasicknowledgeofhowtoaccesstheGPIOpinssothatyou
canaccessallsortsofadditionalhardwarecapabilities.
Chapter3,AddingDisplayFunctionality,showsyouhowtheGalileocanbeconnectedto
adisplaysothatyoucanbothseeoutputandalsogetinputfromatouchscreen.Oneofthe
firstthingsyoumightwanttodoistoconnectadisplayuptotheGalileo.
Chapter4,ControllingDCMotors,detailshowtocontrolaDCmotorsothattheunitcan
drivewheelsortracks.
Chapter5,AddingSensors,showsyouhowtoaddIR,Sonar,andevenacompasstoyour
project.
Chapter6,RemoteControl,covershowtocommunicatewirelesslywithyourGalileo
projects,asyoumaywanttoaccessyourprojectswithoutconnectingwires.
Chapter7,GoingFurtherwithGalileo,introducesyoutotheLinuxcapabilitiesofthe
Galileousingtheexampleofconstructingaquadrupedrobot.
Chapter8,SpeechOutput,covershowtomakeyourprojecttalkasanexampleofhowto
usefree,opensourcesoftwaretoaddcomplexfunctionalitytoyourprojects.Oneofthe
amazingfeaturesoftoday’scomputersystemsistheabilitytoprovideoutputwithouta
screenorkeyboard.