CodeBlocks-Arduino Addons To Code Blocks To Support Arduinos and ATtinys
CodeBlocks-Arduino Addons To Code Blocks To Support Arduinos and ATtinys
provideyourown/CodeBlocksArduino:AddonstoCode::BlockstosupportArduinosandATtinys
Thisrepository
Search
Pullrequests
Issues
Gist
provideyourown / CodeBlocksArduino
Code
Issues 9
Unwatch
Pullrequests 2
Wiki
Pulse
18
Unstar
Fork
42
35
Graphs
AddonstoCode::BlockstosupportArduinosandATtinys
11commits
Branch:master
1branch
Newpullrequest
Newfile
Uploadfiles
2releases
Findfile
HTTPS
1contributor
DownloadZIP
https://github.com/provideyourown/CodeBlocksArduino.git
scottdkyAddedsupportforATtinypindefsinthesketchesdirectoryinsteado
Latestcommit0cdf649onAug18,2013
helpers
ImplementednewArduinolinkertosupportATtiny:
3yearsago
wizards/arduino
AddedsupportforATtinypindefsinthesketchesdirectoryinsteado
3yearsago
.gitignore
ImplementednewArduinolinkertosupportATtiny:
3yearsago
LICENSE
AddedLicense&wroteReadme.Attemptedlibincludecode.
3yearsago
README.md
AddedsupportforATtinypindefsinthesketchesdirectoryinsteado
3yearsago
default.conf
Fixedsomebugsaddedtoolstodefault.confexpandedReadmedocs.
3yearsago
README.md
CodeBlocksArduino(version:1.0b2)
20122013ScottDaniels(http://provideyourown.com)underGNUGeneralPublicLicense
Portionsare:2012StanleyHuang([email protected])underGNUGeneralPublicLicense
CodeBlocksArduinocontainsaddedfunctionalityforCode::BlockstoallowArduinosoftwaredevelopment.Code::Blocksisa
moreadvancedIDEthantheArduinoIDE,yetisstillfairlystraightforward.WhenanArduinoprojectstartsincorporating
customlibraries,itoftenbecomestoocumbersomefortheArduinoIDE.Thispackageaddsacustomprojectwizardfor
creatingArduinoprojects.ThedistributionalsointegratesthelatestArduinocorefilesandlibraries,AVRtoolchains,avrdude
foruploading,andaserialterminal.
Features
DedicatedprojectwizardforArduinodevelopment
IntegratedArduinocorefilesandlibraries
IntegratedpreconfiguredAVRcompilertoolchain
IntegratedAVRDUDEforuploading(FlashandEEPROM)viaUSBorprogrammer
Integratedserialterminal
VariousArduinoboardssupportedasbuildtargets
Installation
CertainfilesmustbeplacedintheCode::Blocks'datafolder.ThefollowinginstructionsapplytoLinuxcomputers.Forother
operatingsystemsinstallations,contributionsonhowtodoitarewelcomehttp://provideyourown.com/contact.
ThedatafolderforCodeBlocksislocatedin:
https://github.com/provideyourown/CodeBlocksArduino/
1/5
5/4/2016
provideyourown/CodeBlocksArduino:AddonstoCode::BlockstosupportArduinosandATtinys
/home/USER/.codeblocks
Inthisfolderplace:
1.AsymlinktoyourArduinodirectory.Itmustbenamedarduino.ForexampleifyourArduinoinstallisat:
/home/USER/bin/arduino1.0.3
thenusethiscommand(fromwithin/home/USER/.codeblocks):
$lns/home/USER/bin/arduino1.0.3arduino
2.AsymlinktoyourSketchesdirectory.Itmustbenamedsketches.ForexampleifyourSketchesdirectoryisat:
/home/USER/mySketches
thenusethiscommand(fromwithin/home/USER/.codeblocks):
$lns/home/USER/mySketchessketches
3.Copythehelpersdirectorytothecodeblocksfolder(or'symlink'it)
4.Thereshouldbethefollowingfolderpath:
/share/codeblocks/templates/wizard
Ifthereisnot,thencreateit.Thecopythefolder/wizards/arduinotothewizardfolder.
5.Copythedefault.conffile
Whenyouaredone,yourdatafoldershouldlooklikethefollowing:
arduino>/home/USER/bin/arduino1.0.3
sketches>/home/USER/mySketches
default.conf
helpers
share
The/share/codeblocks/templates/wizardfoldershouldlooklike:
arduino
InstructionsforCode::Blocksnewerthanversion10
Whenyoutrytocreateanewproject,newerversionsofCode::Blockswillnotshowthearduinowizardbydefault.Thewizard
mustfirstberegistered.Todoso,selectNew/Projectfromthemenu.Thenrightclickonanyofthewizards.SelectEdit
GlobalRegistrationScript.UnderthefunctionRegisterWizards(),placethisline:
RegisterWizard(wizProject,_T("arduino"),_T("ArduinoProject"),_T("EmbeddedSystems"));
andsavethefile.Itwillbeplacedinyouruserwizardfolder.
Forfurtherdetails,seehttp://wiki.codeblocks.org/index.php?title=Wizard_scripts
https://github.com/provideyourown/CodeBlocksArduino/
2/5
5/4/2016
provideyourown/CodeBlocksArduino:AddonstoCode::BlockstosupportArduinosandATtinys
Using
CreatinganArduinoProjectusingtheWizard
1.LaunchCode::Blocks.SelectNew/Projectmenuitem.YoushouldseeArduinoProjectinred.Ifyoudonot,then
somethinginyourinstallationiswrong.
2.SelectArduinoProject.Aftertheintropage,thenextpagewillbewhereyouconfigureyourproject.Mostofthedefaults
arefinetouse.IfyouareusingaprogrammerinsteadoftheArduinobootloadertoprogramyourdevice,selectthe
programmeryouwillbeusing.Also,nowisthetimetochoosetheserialporttouseforuploadingyourcode.
TIPforserialportselection:
ForUsbaspprogrammers,choosettyUSB0.
ForUno&Leonardo,choosettyACM0inmostcases.
Forallothers,ttyUSB0isasafebet.
Note:Youcanchange/selecttheboardfromtheBuildtargetmenuafterfinishingthewizard.Theprogrammerandserial
portremainthesameforeachboard.Theycanbechangedforindividualboardsaftercompletingthewizardseethe
Modifyingsectionfordetails.
3.Onthenextpage,creatinganewprojectisprettyselfexplanatory.IfyouareusinganexistingArduinoproject,dothe
following:
a.SelectthefoldertocreateprojectinthiswillbeyourexistingArduinoprojectfolder
b.Giveittheprojecttitleusuallythiswillbethesameasthefoldername
c.EdittheResultingFilenameboxandremovetheextrafolderbeingcreated
ToolsMenu
SeveraltoolsareprovidedintheToolsmenu.Theyare:
SerialTerminal
UploadCode
UploadEEPROM
ArduinoMake
ArduinoMake(Clean)
ArduinoMake(Upload)
SerialTerminalTool
ThistoolopensaserialcommwindowjustliketheArduinoIDE.Itdoesnotcloseautomaticallybeforeanupload,soifusing
thesameserialportforuploading,youwillneedtoclosethiswindowfirst.
UploadTools
Ifaftercompiling,youneedtouploadyourcodeagain,usetheUploadCodetool.EEPROMdataisnotuploadedbydefault,
sotheUploadEEPROMtoolisprovidedforthat.
ArduinoMake
ThesetoolsinvokethemakefunctionusingcommandlineArduinoMaketool(https://github.com/sudar/ArduinoMakefile).You
mustinstallthisscriptandcreateyourconfigfilewithinyourprojectfolderbeforeusing.Youcanaddyourownadditional
makecommandsfromtheConfiguretools...menuitemintheToolsmenu.
GitG
https://github.com/provideyourown/CodeBlocksArduino/
3/5
5/4/2016
provideyourown/CodeBlocksArduino:AddonstoCode::BlockstosupportArduinosandATtinys
ThistoollaunchestheGitGapplicationforyourproject.
Modifying
Sometimesyouneedtomodifyaprojectaftercreatingit.Formostsettings,gotoProject/BuildOptions....Youwillfind
differentsetsofoptionsforboththeprojectandindividualtargetdevices.Thetwosetsaremergedatcompiletime(youcan
changethisifdesired),soyouwillneedtocheckbothwhenlookingforconfigurationstochange.Somecommononesyou
mightwanttochangeare:
CompilerSettings/#defines(projectsetting)arduinoversion&whatcorelibrariestoinclude
CustomVariables(devicesetting)
programmerprotocol
uploadport
YoucanselectwhichboardtocompileanduploadyourprogramtobychoosingfromtheBuildtargetmenuinthetoolbar.
Thiswillchangetheappropriateuploadsettings,withtheexceptionoftheprogrammerusedandtheuploadport.
Programmer
ForArduinoboardswithbootloaders,thecorrectprogrammerisalreadychosen.Forotherboardsusingaprogrammer,the
onechoseninthewizardwillbetheoneused.Ifitneedstobechanged,thengototheProject/Buildoptions...andselectthe
correctbuildtargetandgototheCustomVariablestab.EditthecorrectPROTOCOLthere.
UploadPort
Thecorrectportvariesacrosstheboards.DifferentISPprogrammersmayhavetheirownport.TheUnoandLeonardousea
differentportthantheirpredecessors.Ifyouhaveotherdevicessharingthesameportlabelingsystempluggedin,thenthe
portnumberwillchange.
Inmostcases,thesevalueswillwork:
Uno/Leonardo:ttyACM0(becauseLeonardoconnects&disconnectsallthetime,expectittochangefromtimetotime,
usuallytottyACM1orttyACM2.
Usbaspprogrammers:ttyUSB0
Allothers:ttyUSB0isasafebet.
Tochangetheportforaboard,thengototheProject/Buildoptions...andselectthecorrectbuildtargetandgototheCustom
Variablestab.EditthecorrectUPLOAD_PORTsettingthere.
KnownIssues
1.ThemethodoflinkingusedisnotasefficientastheArduinoIDE.Nosolutionisknownatpresent.Inmostprojectsit
won'tmatter,butifaprojectisreachingthemaximumflashmemorypoint,itmaybeaproblem.
2.Leonardouploadingisstillproblematic(andnotrecommendedatthistime),andautomaticresetdoesnotwork.
SometimesuploadingwillputtheLeonardoinanunresponsivestate.Theonlywaytoreviveitistouploadasketchfrom
theArduinoIDEwhilepressingtheresetbutton(sometimesithastobedonemorethanonce).
3.EverythinghasbeenwrittenandtestedonLinuxsystems.UseonWindowssystemsmayrequiresometweaking
UploadportselectionandToolmenusettings.
FuturePlans
1.Fixknownissues
2.Domorewithcommandlinemaketool?
https://github.com/provideyourown/CodeBlocksArduino/
4/5
5/4/2016
provideyourown/CodeBlocksArduino:AddonstoCode::BlockstosupportArduinosandATtinys
3.Makesketch.cppfilemorecompatiblewiththeArduinoIDEsketch.inofile(eliminatetheneedforboth)whenusingeither
IDE.
Changelog
8/18/13directoryincludesimprovements:
Improvedvariousdirectoryincludes:
ThehardwaredirectoryforATTinysupportisnowlocatedinthesketchesdirectoryasperstandardArduinoIDE
location.YoucangetsupportformostATTinychipsherehttps://github.com/provideyourown/attiny.git
Thelibrariesdirectoryforyoursketchesisnowincludedbydefault.Librariescannowbeincludedbynameonly
withoutspecifyingarelativepathjustliketheArduinoIDE.
1/17/13bugfixesToolsmenuchanges:
ToolsMenu:
Generalizeduploadcmdstoworkwithanytargetboard
Addedsupportforcommandlinemaketool(https://github.com/sudar/ArduinoMakefile)
AddedDoptiontoavrdudeforArduinoboards(mustnotbeusedforATtinys)
Removeddefaultportselection(can'tgetittowork)
AddedmoreinstructiontoREADMEfile
1/16/13changestoStanleyHuang'soriginalcode:
AddedsizecalculationtopostprocessingstepstocalculatebothflashmemoryandSRAM.
FixedavrdudeconfigurationtoworkwithATtiny
AddedsupportforLeonardo
AddedsupportforalternativeconfigurationssuchasATtinyboards
AddedsupportforISPprogrammersforuploads
AddedsupportforCode::Blocksversion12
AddedtooltipstoWizardoptions
https://github.com/provideyourown/CodeBlocksArduino/
5/5