[PDF] [PDF] Arduino documentation

10 nov 2012 · Programming an Arduino Board through USB Choose TOOLS, BOARD, DIGISPARK (DEFAULT 16,5 MHz) • Choose TOOLS 



Previous PDF Next PDF





[PDF] How to use Arduino Uno

Select the programmer Arduino ISP , if this is not selected must select the Check that the proper port is selected in the Tools > Serial Port menu (if your port



[PDF] Using the ATmega1284 with the Arduino IDE - Hackadayio

7 juil 2020 · described in my earlier article Using the Arduino IDE Without Cores to the Boards menu, for an ATmega1284 with the default 1 MHz internal Connecting the Tiny AVR Programmer Board to an ATmega1284 for ISP 



[PDF] XSP - Arduino Programmer SKU:DFR0360 - uri=mediadigikey

15 août 2017 · XSP arduino Programmer is designed for Arduino/AVR device Support both ISP and FTDI No Arduino IDE builtin driver in Windows • High Efficiency DTR signal - If be enabled, high level default When you open the 



[PDF] PROGRAMMING WITH ARDUINO - Centro E Piaggio

The Arduino Programming Environment (IDE) The Arduino Software (IDE) - contains a text editor for writing code, a message It defaults to 10 bits (returns 



[PDF] Introducing Trinket - RS Components

9 sept 2016 · Even though you can program Trinket using the Arduino IDE, it's not a fully 100 By default, we install the Feather 32u4 , Feather M0, Flora and Trinket / Pro Trinket / 2) Select USBtinyISP from the Tools->Programmer



[PDF] Arduino documentation

10 nov 2012 · Programming an Arduino Board through USB Choose TOOLS, BOARD, DIGISPARK (DEFAULT 16,5 MHz) • Choose TOOLS 



[PDF] Getting started with the Arduino Due

To upload a sketch, choose Arduino Due (Programming port) from the Tools > Board menu in the Arduino This Programming port is the default for uploading  



[PDF] Introduction à Arduino

Arduino est une plate-forme de prototypage programmer directement en langage Java ○ Pourquoi ? type de carte » suivant les versions d'IDE) caractères ASCII pour chaque chiffre, par défaut avec 2 décimales derrière la virgule ○



[PDF] Developing Bootloader for Arduino Contd - NIELIT

27 avr 2020 · Arduino IDE uses the avrdude tool which is used to upload/download the and supported by the serial programming protocol, it can also 



[PDF] Omega MP - Welcome to One Byte CPU

Multi-Programming Shield for Set programmer under 'Tools > Programmer' to ' Arduino as ISP' c To burn This is the default and most common configuration

[PDF] arduino tutorial pdf

[PDF] arduino tutorials point pdf download

[PDF] arduino uno application

[PDF] arduino uno description

[PDF] arduino uno documentation

[PDF] arduino uno literature review pdf

[PDF] arduino uno pdf free download

[PDF] arduino uno pdf in hindi

[PDF] arduino uno pdf manual

[PDF] arduino uno pdf schematic

[PDF] arduino uno pdf tutorial

[PDF] arduino uno pin diagram

[PDF] arduino uno pinout

[PDF] arduino uno pinout pdf

[PDF] arduino uno pins

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13T leofcontentsForeword............................................................................................................................................2Introduction......................................................................................................................................61.Versionhistory.......................................................................................................................................7ArduinoBoards................................................................................................................................92.Arduino...................................................................................................................................................103.ArduinoUNOR3.................................................................................................................................134.ArduinoNanov3.0.............................................................................................................................145.Boarduino..............................................................................................................................................156.AVRDevelopmentboardasArduino.........................................................................................177.Arduinoonabreadboard...............................................................................................................198.Attiny45/Attiny85.............................................................................................................................219.Attiny85Digisparkboard...............................................................................................................2510.ESP8266MCU....................................................................................................................................28Software...........................................................................................................................................2911.ArduinoIDE.......................................................................................................................................3012.Processing...........................................................................................................................................3213.Fritzing.................................................................................................................................................35Programming/Programmers..................................................................................................3614.ProgramminganArduinoBoardthroughUSB...................................................................3715.USBaspv2.0programmer............................................................................................................3816.AVRISPtoICSPAdapter...............................................................................................................4017.UploadingthebootloaderbyusinganArduinoasISP....................................................4218.AVRAtmega8/168/328Developmentboard.....................................................................4319.Self-madeAttiny45/85ISPadapter.......................................................................................45Sound................................................................................................................................................4620.Buzzer...................................................................................................................................................4721.PiezoSpeaker....................................................................................................................................49LED(displays)................................................................................................................................5122.OnboardLEDD13............................................................................................................................5223.LED.........................................................................................................................................................5324.RGBLEDboard.................................................................................................................................5625.8x8DOTMatrix1088AS...............................................................................................................5826.8x8DOTMatrix1388ASR...........................................................................................................6027.8x8DOTmatrixwithMAX7219chip......................................................................................6228.SingleDigit7-SegmentDisplay..................................................................................................6629.4Digits7-SegmentDisplay.........................................................................................................7130.8Digits7-SegmentDisplaywithTM1638chip..................................................................7531.WS2812BRGBLEDbreakout-board.......................................................................................78LCD/TFTdisplays.........................................................................................................................8132.Nokia5110/3310LCD..................................................................................................................8233.16x2DisplaywithLCM1602chip............................................................................................8634.Adafruit2.8"TFTResistiveTouchShieldv2.......................................................................8935.2.4"TFTLCDShieldTouchBoard............................................................................................93Inputsensors.................................................................................................................................9736.Switches...............................................................................................................................................9837.OpticalSwitchITR8102.............................................................................................................103

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16IntroductionInthisdocumentI'vedescribedthebasicuseofsomeArduinoBoards,Software,Programmer/Programmingandseveralcomponentstobeusedasinputoroutputdevices.Mostchaptersconsistofthefollowingparagraphs:• SpecificationsTechnicalinformationneededwhenusingthiscomponent.• DatasheetLinkstodatasheet(s)relatedtothecomponentorpartsofthecomponent.• ConnectionsNames,descriptionandportstobeusedonyourArduino• LibrariesneededDownloadlinksto3rdpartylibrariesandnamesofthestandardlibrariestobeusedwiththiscomponentand• LibraryuseexplanationDescriptionhowtousethelibrarytogetyoustarted.Noin-depthexplanation!• SampleSamplesketchandneededconnectionstotestthecomponent.Foreverycomponent,thedescriptioniscomposedofalltheinformationyouneedtogetthingsstarted.Usethesamplesketchandyourowncreativitytobuildmorecomplexsketches/projects.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.171. VersionhistoryThischapterdescribeschangesmadetothisdocument:Ver.ChangesDate1.0FirstversionsharedMay8th20141.1• AddedthisVersionHistory.• Added"17UploadingthebootloaderbyusinganArduinoasISP".• Added"34"Adafruit2.8"TFTResistiveTouchShieldv2"• Correctedsomesmalltypo's.Sep14th20151.11• Added35"2.4"TFTLCDShieldTouchBoard"• Changedtheorientationofthe"34"Adafruit2.8"TFTResistiveTouchShieldv2",thussimplifyingtheuseofthelibraryandthesamplesketch.• Correctedsomesmalltypos.• Addedlinkstodatasheetsforseveralcomponents.• Addedspecificationsforseveralcomponents.• CorrectionmadetobothBluetoothmodules.AvoltagedividerhasbeenaddedtotheRxDportoftheBluetoothmodule,creatinganinputvoltageof3.3Vinsteadof5V.• AddedanextraSampletotheKeyesBluetoothmodule,UsingD10andD11throughSoftwareSerial.Sep22nd20151.12• Correctionmadeto"8.4PreparationofArduinoIDEforAttiny45/85"forArduinoIDE1.6.5.• Added"9Attiny85Digisparkboard".• AddedasampleofPWMoutput(LEDfadesample)in:"23.4SampleLED".• Added"31WS2812BRGBLEDbreakout-board"• Added"42NunchukwithconnectionboardonA2..A5"• AddedaProcessingsampletoNunchukin"42.3SampleNunchukwithconnectionboardonA2..A5".• Added"61SoftEasyTransfer"• Added"67IRRemoteControl4"• Added"72NRF24L012.4GHZWirelesTransceiver"• MovedSectionsWiredandWirelesscommunicationdown,justbeforesectionShields• MovedSectionIsolationfromhighervoltagesdown,justbeforesectionShields.• AddedSectionESP8266Wi-Fi.• AddedChaptersforusingtheESP8266.• AddedSection"RaspberryPi.• AddedSectionMindstormsNXTinTo-do.• Correctedatruckloadofsmalltypo'sNov1st2015currentversion

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.18Ver.ChangesDate1.2• FinishMindstormsNXTconnectiontoArduino(descriptionofsampleprogram).• AddchapterabouttheSerialMonitor.SamplesketchesforbothOutput(fromArduinotocomputer)andInput(fromcomputertoArduino).• Addphoto,librarydescription,datasheet,specsIRsend• Addmissingphoto's• AddphotoBluetoothJY-MCU(HC05master/slave)• AddConnectingMindstormsNXTtoArduino.• AddConnectingMindstormssensorswithArduinohttp://www.instructables.com/id/How-to-use-LEGO-NXT-sensors-and-motors-with-a-non-/• AddconnectingArduinotoRaspberryPi• AddProgrammingArduinowithaRaspberryPi.• Addatablewithallusedlibrariesanddownloadlinks,soitiseasiertomaintainaccessibilityandtoprevent404-errorswhenfollowingthelinks.Worknotyetstarted!

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.19ArduinoBo rdsThissectiondescribestheArduinoboardsI'vebeenusing,liketheArduinoUNO,theNANOandeventheAttiny45/85.Foreachboardyouwillfindspecifications,connectionsandprotocols.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1102. Arduino"ARDUINOISANOPEN-SOURCEELECTRONICSPROTOTYPINGPLATFORMBASEDONFLEXIBLE,EASY-TO-USEHARDWAREANDSOFTWARE.IT'SINTENDEDFORARTISTS,DESIGNERS,HOBBYISTSANDANYONEINTERESTEDINCREATINGINTERACTIVEOBJECTSORENVIRONMENTS1"SinceArduinoisOpenSource,theCADandPCBdesignisfreelyavailable.Everyonecanbuyapre-assembledoriginalArduinoboard2oraclonedboardfromanothercompany.YoucanalsobuildanArduinoforyourselforforselling.AlthoughitisallowedtobuildandsellclonedArduinoboards,it'snotallowedtousethenameArduinoandthecorrespondinglogo.MostboardsaredesignedaroundtheAtmelAtmega328.2.1. Popul rArduino o rdsThereareseveraldifferentArduinoboardsonthemarket(bothoriginalandcloned).• ArduinoUNOo Mostpopularboard.Idealforstarters.o StandardUSBfordataandpowerandprogramming.o PowerInputconnector.o femaleheaders.o 14digitalI/Oports(ofwhich6PWM).o 6analoginputports.o 1hardwareserialport(UART).• ArduinoNanoo MuchsmallerthantheUNO(only18x43mm).o MiniUSBfordataandpowerandprogramming.o Input6-20VonVinn(6-12recommended).o Maleheadersatthebottomside,soidealtouseonasolderlessbreadboard.o 14digitalI/Oports(ofwhich6PWM).o 8analoginputports.o 1hardwareserialport(UART).• ArduinoMinio SmallestArduinoboard,usedinsmallsizedprojects.o NoUSBconnector,youneedaUSBtoserialconvertortoprogramthisboard.o Noseparatepowerconnector(youmustuse+9Vheaderpins)o Input7-9V.o Maleheadersatthebottomside,soidealtouseonasolderlessbreadboard.o 14digitalI/Oports(ofwhich6PWM).o 8analoginputports(4ofthemarenotconnectedtoheaderpins).o Nohardwareserialport(UART).1Quotefromthearduino.ccwebsite.2MostoriginalArduinoboardsaremadebySmartProjectsinItaly.TheArduinoPro,LilypadandProMiniaremadeanddesignedbySparkfunintheUS.TheoriginalArduinoNanoisbuildbyGravitech.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.111• ArduinoMegao LargestArduinoboardforlargenumberofI/Oports.o NormalsizeUSDfordataandpowerandprogramming.o Powerinputconnector.o Input6-20V(7-12recommended).o Femaleheadersatthetopside.o 54digitalI/Oports(ofwhich15PWM).o 16analoginputports.o 4serialports.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1122.2. ConnectionsThefollowingconnectionsareavailableonmostArduinoboards.DifferencescanbefoundinthenumberofDigitalI/OandAnalogInputs.CommonconnectionsNameDescriptionGNDGround5VRegulated5VoutputRegulated5Vinput(notrecommended)3.3VRegulated3.3Voutput(fromFTDI)VINNon-regulatedinput(6-12V)RESETIOREFAREFDxDigitalInput/Output.Twovalues:LOW,HIGHDx~DigitalInput/OutputPWM.Values:0..255throughPWM(PulseWidthModulation)AxAnalogInput.Values:0..1023Sh redconnectionsNameSharedwithDescriptionRXD0TTLSerialReceiveDXD1TTLSerialTransmitSCKD13SPISerialClockMISOD12SPIMasterInSlaveOutMOSID11SPIMasterOutSlaveInSSD10SPISlaveSelectSDAA4I2C/TWIDataSCLA5I2C/TWIClockICSPhe derAllSPIheadersarealsoavailableonaseparatedoublerowofheaderpins.GND65RSTMOSI43SCK+VCC21MISOICSP

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1133. ArduinoUNOR3Specific tionsMicrocontrollerAtmega238OperatingVoltage7-12Vrecommended,6-20VlimitsDigitalI/Opins14(ofwhich6PWM)Analoginputpins6DCcurrentperI/Opin40mADCcurrentfor3.3Vpin50mAFlashmemory32KBUSBtoSerialconverterAtmega16U2UART13VavailableL yout/connectionsArduinoUNOR332SCL31SDA30AREF29GND?128D13SPISCKonboardLEDIOREF2Atmeg 32827D12SPIMISORESET326D11~SPIMOSI3.3V425D10~SPISS5V524D9~GND623D8GND7Vin822D721D6~A0920D5~A110RSTSCKMISO19D4A21118D3~IRQ1A31217D2IRQ0SDAA413531ICSP16D1TTLserialTxSCLA51464215D0TTLserialRxGNDMOSI+VCC

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1144. ArduinoN nov3.0Specific tionsArduinoN nov3.0MicrocontrollerAtmega238OperatingVoltage7-12Vrecommended,6-20VlimitsDigitalI/Opins14(ofwhich6PWM)Analoginputpins8DCcurrentperI/Opin40mADCcurrentfor3.3Vpin50mAFlashmemory32KBFTDIUSBtoTTLserialFTDIFT232RLUART13.3VOnlyavailablethroughFTDI,soonlywhenpoweredthroughUSB!L yout/connectionsArduinov3.0onboardLEDSPISCKD13130D12SPIMISO3.3V229D11~SPIMOSIAREF328D10~SPISSA0427D9~A1526D8A2625D7A3724D6~SDAA4823D5~SCLA5922D4A61021D3~IRQ1A711+VCCMOSIGND20D2IRQ05V1219GNDRESET1318RESETGND14246ICSP17D0TTLserialRxVin1513516D1TTLserialTxMISOSCKRST

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1155. Bo rduinoBoarduinoisaDYI-kitArduino.YoucanbuythePCBandcomponentseparatelyorasakit.ComparedtothepricesoftheoriginalArduinoboards,aBoarduinoismuchcheaperandsmaller.TheBoarduinolacksanUART(noserialport)andaprogrammingchip,soyou'llneedsomekindofprogrammer.5.1. Specific tionsBo rduinoSamespecsastheArduinoUNO,butitlackstheUSBportandUART(serialport1),soyou'llneedaexternalprogrammertouploadyourcompiledsketches.MicrocontrollerAtmega238OperatingVoltage7-12Vrecommended,6-20VlimitsDigitalI/Opins14(ofwhich6PWM)Analoginputpins6DCcurrentperI/Opin40mADCcurrentfor3.3Vpin50mAFlashmemory32KBUSBtoSerialnoneUARTnone3.3VNOAVAILABLE5.2. D t sheetBo rduinoAtmeg 328P-PU• http://www.farnell.com/datasheets/1684409.pdf1Toaddaserialporttothisprogrammer,seechapter100USBtoRS232/TTLcable.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1165.3. BuildingInstructionsBo rduinoShoppinglist:#Item#Item1Atmega328P-20PU4CeramicCapacitor0,1uF128-pinsocketDIL1Electrolyticcapacitor46uF/25V116MHZceramicresonator1Electrolyticcapacitor100uF/6,3V12.1mmPowerJackPCBmount1LEDred11N4001diode1LEDgreen15Vregulator7805TO-220package16mmtactswitch110Kohm,¼Wattresistor1Jumper21Kohm,¼Wresistor1BoarduinoPCB43maleheader0.1"spacing3x3pin2x6pin1x4pin1x8pin1x10pinInstructions:• http://learn.adafruit.com/boarduino-kits5.4. L yout/connectionsBo rduino

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1176. AVRDevelopment o rd sArduinoWiththisdevelopmentboardyoucanprogramAtmega8,Atmega168andAtmega328MCU'sthroughthe10pinsISPconnector.YoucanalsouseitasanArduinoBoardwithoutanUART(i.e.withoutaserialconnectionthroughUSB).UsethelayoutbelowtomatchtheAtmega328toArduinopinassignment.6.1. Specific tionsAVRDevelopment o rd sArduinoSamespecsastheArduinoUNO,butitlackstheUSBportandUART(serialport1),soyou'llneedaexternalprogrammertouploadyourcompiledsketches.MicrocontrollerAtmega238OperatingVoltage7-12Vrecommended,6-20VlimitsDigitalI/Opins14(ofwhich6PWM)Analoginputpins6DCcurrentperI/Opin40mADCcurrentfor3.3Vpin50mAFlashmemory32KBUSBtoSerialnoneUARTnone3.3VNOTAVAILABLE6.2. D t sheetAVRDevelopment o rd sArduinoAtmeg 328P-PU• http://www.farnell.com/datasheets/1684409.pdf1Toaddaserialporttothisprogrammer,seechapter100USBtoRS232/TTLcable.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1186.3. ConnectionsAVRDevelopment o rd sArduino

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1197. Arduinoon re d o rdThemostimportantpartofyourArduinoistheAtmega328P-PU.ThisMCU(MicroControllerUnit)andan16MHzoscillatoristheheartofyourboard.PuttingthisonasolderlessbreadboardtogetherwithsomeresistorsandcapacitorsyoucanbuildyourownArduinoboard.7.1. Specific tionsArduinoon re d o rdSamespecsastheArduinoUNO,butitlackstheUSBportandUART(serialport1),soyou'llneedanexternalprogrammertouploadyourcompiledsketches.MicrocontrollerAtmega238OperatingVoltage7-12Vrecommended,6-20VlimitsDigitalI/Opins14(ofwhich6PWM)Analoginputpins6DCcurrentperI/Opin40mADCcurrentfor3.3Vpin50mAFlashmemory32KBUSBtoSerialnoneUARTnone3.3VNOTAVAILABLE7.2. D t sheetArduinoon re d o rdAtmeg 328P-PU• http://www.farnell.com/datasheets/1684409.pdf1Toaddaserialporttothisprogrammer,seechapter100USBtoRS232/TTLcable.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1207.3. ConnectionsAtmeg 328P-PUAtmega328ArduinopinAtmega328ArduinopinPC0A0PB0D8PC1A1PB1D9(PWM)PC2A2PB2D10(SS,PWM)PC3A3PB3D11(MOSI,PWM)PC4A4PB4D12(MISO)PC5A5PB5D13(SCK)PD0D0(Rx)PC6ResetPD1D1(TxVCC5VPD2D2GNDGNDPD3D3(PWM)PB6crystalPD4D4PB7crystalPD5D5(PWM)GNDGNDPD6D6(PWM)AREFAREFPD7D7AVCC?7.4. S mpleArduinoon re d o rdTobuildyourownArduinoonabreadboard,youwillneedthefollowingcomponents:• 5Vregulatedpowersupplyo Seechapter:97BlackWingsORo Seechapter:99DCStep-DownAdjustablePowermoduleORo Selfmaderegulator:§ 2x7805Voltageregulator§ 2x10uFCapacitor§ 1xLED(optional)§ 1x220ohmResistor(optional)• 1xAtmega328P-PUwithanArduinobootloader.• 1x16MHzoscillator• 2x22pF• 1xLED(optional)• 1x220ohmResistor(optional)• 1x10kOhmResistor• 22AWGwire(forexampleapieceofsolidcoreUTPcable)• smallmomentaryNO(normallyopen)buttonInstructionsforbuildingthisArduinoonabreadboardcanbefoundat:http://arduino.cc/en/Main/Standalone

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1218. Attiny45/Attiny85TheAttinychipsarenotrealArduino's,butcanbeusedasapermanentreplacementforprojectswithverylimitedportusage.BesidesVCCandGNDyouwon'tanyothercomponents,soidealtoshrinkifyyourprojects.NotalllibrariesandfunctionsareavailablefortheAttinychips,butatlotofthemhavebeenported.ThefollowingArduinocommandsshouldbesupported:• pinMode()• digitalWrite()• digitalRead()• analogRead()• analogWrite()• shiftOut()• pulseIn()• millis()• micros()• delay()• delayMicroseconds()• SoftwareSerial8.1. Specific tionsAttiny45/Attiny85TheAttiny45/85lacksalotoffeaturesthatanArduinoboardhas,likeaserialport1andaspecializedRx-(Receivedata)andaTx-pin(Transmitdata).MicrocontrollerAttiny45/85OperatingVoltage2.7-5.5V(0-10MHz)4.5-5.5V(0-20MHzexternalclock)DigitalI/Opins2(PWM)Analoginputpins3Flashmemory4/8KB1Toaddaserialporttothisprogrammeryou'llneedtosacrifice2portsforRxandTx,theSoftwareSeriallibraryandaUSBtoRS232/TTLcable(seechapter100).

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1228.2. L yout/connectionsAttiny45/Attiny85analoginput2Reset1dot8VCCanaloginput3PB327PB2analoginput1,SCKanaloginput4PB436PB1PWM,MISOGND45PB0PWM,AREF,MOSI8.3. D t sheetAttiny45/Attiny85http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-Attiny25-Attiny45-Attiny85_Datasheet.pdf8.4. Prep r tionofArduinoIDEforAttiny45/85ThissectiondescribeshowtoaddsupportfortheAttiny45/85totheArduinoIDE.Moredetailscanbefoundat:http://highlowtech.org/?p=1695• OpenArduinoIDEandgotoFILE,PREFERENCES.• CutandpastthefollowinglinkintheboxADDITIONALBOARDSMANAGERURL'S.(Youcanaddmultiplelinkshere,byusinga';'asseparator.)https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json• ClosePREFERENCESbyclickingontheOKbutton.• GotoTOOLS,BOARD,BOARDSMANAGER.• SearchforAttiny(thiscouldtakeafewseconds)andselecttheATTINYBYDAVIDA.MELLIS.• ClickontheINSTALLbutton• PresstheCLOSEbutton.• AttinyisnowlistedatTOOLS,BOARD.Onetimeprep r tiontorunAttiny t8MHz.TomakeyourAttinyalsorunat8MHz(thisisneededforseverallibraries)1,youwillneedtoloadedthecorrectbootloadertoyourAttiny.• ChooseTOOLS,BOARD,ATTINY.• GotoTOOLS,PROCESSOR,choosetheappropriateAttiny(Attiny45/85/44/84).• ChooseTOOLS,POCESSOR,8MHZINTERNAL2• Choosewhichprogrammeryouaregoingtouse:o "17UploadingthebootloaderbyusinganArduinoasISP"o "15USBaspv2.0programmer"o "19Self-madeAttiny45/85ISPadapter"o AVRprogrammer(notyetdescribedinthisdocument)• ConnectyourprogrammertoyourAttinyo ConnectSSorRSTtoAttinypin1.1http://42bots.com/tutorials/how-to-program-Attiny85-with-arduino-uno-part-2/2Don'tchoosetheexternalclocksettingsunlessyouhaveanexternalclock.Aftersettinganexternalclockyouwon'tbeablethechangeitbacktointernalbeforeyouaddanexternaloscilatortoyourAttiny.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.123o ConnectMOSItoAttinypin5.o ConnectMISOtoAttinypin6.o ConnectSCKtoAttinypin7.o ConnectGNDtoAttinypin4.o Connect5VtoAttinypin8.• GotoTOOLS,BURNBOOTLOADER.• Youshouldseeamessagesaying:"DoneburningbootloaderBelowyouwillfindasampletocontrolaservowiththealternativeSoftwareServolibrary.8.5. Progr mmingtheAttiny45/Attiny851• ChooseTOOLS,BOARD,ATTINY.• GotoTOOLS,PROCESSOR,choosetheappropriateAttiny(Attiny45/85/44/84).• ChooseTOOLS,POCESSOR,8MHZINTERNAL2or1MHZINTERNAL.Aslongasyouhaven'tprogrammedthe8MHzbootloadertoyourAttiny(see"OnetimepreparationtorunAttinyat8MHz."),makesureyourprogrammersupportsaslowclockspeedof1MHzthatisdefaulttotheAttiny.Forexample,whenyouusetheUSBaspasaprogrammeryoushouldplaceajumperonJP3toslowdowntheclockoftheUSBasp.• Choosewhichprogrammeryouaregoingtouse:o "17UploadingthebootloaderbyusinganArduinoasISP"o "15USBaspv2.0programmer"o "19Self-madeAttiny45/85ISPadapter"o AVRprogrammer(notyetdescribedinthisdocument)• ConnectyourprogrammertoyourAttinyo ConnectSSorRSTtoAttinypin1.o ConnectMOSItoAttinypin5.o ConnectMISOtoAttinypin6.o ConnectSCKtoAttinypin7.o ConnectGNDtoAttinypin4.o Connect5VtoAttinypin8.• GotoTOOLS.PROGRAMMER,choosetheappropriateprogrammer(USBASP,ARDUINOASISP,....)• PresstheUPLOADbutton.1http://42bots.com/tutorials/how-to-program-Attiny85-with-arduino-uno-part-1/2Don'tchoosetheexternalclocksettingsunlessyouhaveanexternalclock.Aftersettinganexternalclockyouwon'tbeablethechangeitbacktointernalbeforeyouaddanexternaloscilatortoyourAttiny.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.124S mplesketchServoontheAttiny45/Attiny85http://playground.arduino.cc/ComponentLib/Servo#include SoftwareServo myservo; int pos = 0; void setup() { myservo.attach(1); } void loop() { for(pos = 0; pos < 180; pos += 10) { myservo.write(pos); delay(60); SoftwareServo::refresh(); } for(pos = 180; pos>=1; pos-=10) { myservo.write(pos); delay(60); SoftwareServo::refresh(); } }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1259. Attiny85Digisp rk o rdTheDigisparkboardisoneofthesmallestArduino'sbasedontheAttiny85.ItcontainsaUSBconnectorforuploadingsketchesandpower,apower-onledandanInternalLEDconnectedtoport1fortestingpurposes.NotalllibrariesandfunctionsareavailablefortheAttinychips,butatlotofthemhavebeenported.ThefollowingArduinocommandsshouldbesupported:• pinMode()• digitalWrite()• digitalRead()• analogRead()• analogWrite()• shiftOut()• pulseIn()• millis()• micros()• delay()• delayMicroseconds()• SoftwareSerial9.1. Specific tionsAttiny85Digisp rk o rdTheAttiny45/85lacksalotoffeaturesthatanArduinoboardhas.MicrocontrollerAttiny85OperatingVoltage5Vor7-12VOn-boardpowerregulator5V500mABuilt-inUSBI/Opins6(ifyourprogramactivelycommunicatesoverUSB,2ofthemareusedforUSB)ADCon4pinsPWMon3pins(morepossiblewithSoftwarePWM)Flashmemory8KB(2KBusedbybootloader)ProtocolsI2CandSPI(viaUSI)LEDPowerLEDandTest/StatusLEDPin5hassomelimitations,outputismorelike3.6V,worksfinefornon-currentsourcinguse!GPIOoutput20mAmaxperpin.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1269.2. L yout/connectionsAttiny85Digisp rk o rdNRESUSBUSBSCKMISOMOSIADC0ADC2ADC3ADC4D5D4~D3D2D1~D0~p5p4p3p2p1p0LEDVin6-12VinGNDGND5V5VoutTheDigisparkisbreadboardfriendlyonsmallbreadboardsonly(20holeswide,4.8cmwide).Beforeyousoldertheheaders,youshoulddecidefirsthowyouaregoingtousethisboard.Without re d o rdYouarefreetouseFemaleorMaleheadersontoporonthebottomoftheboard.With sm ll re d o rdSolderMaleheadersatthebottom,forP0..P5andforVinandGND.Solderoneheader(F/M)onTOPfor5V.WhenyouplacetheDigisparkonyourbreadboard,VinwillmatchtheVccbusandGNDtheGNDbus.With wide re d o rdSolderMaleheadersattheBOTTOMforP0..P5.Solder3headersonTOPforVin,GNDand5V(F/M).YoucanplacetheDigisparkonyourbreadboard,butmustuseseparatejumperwirestoconnectVinandGND.9.3. WikiforAttiny85Digisp rk o rdhttp://digistump.com/wiki/digispark9.4. Prep r tionofArduinoIDEfortheAttiny85Digisp rk o rdThissectiondescribeshowtoaddsupportfortheAttiny85DigisparkboardtotheArduinoIDE.Moredetailscanbefoundat:http://digistump.com/wiki/digispark/tutorials/connecting.• OpenArduinoIDEandgotoFILE,PREFERENCES.• CutandpastthefollowinglinkintheboxADDITIONALBOARDSMANAGERURL'S.(Youcanaddmultiplelinkshere,byusinga';'asseparator.)http://digistump.com/package_digistump_index.json

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.127• ClosePREFERENCESbyclickingontheOKbutton.• GotoTOOLS,BOARD,BOARDSMANAGER.• SearchforDigistump(thiscouldtakeafewseconds)andselecttheDIGISTUMPAVRBOARDSBYDIGISTUMP.• ClickontheINSTALLbutton,onaWindowscomputeryouwillnowbeaskedtoinstall(orupdate)thedriversforyourAttinyDigisparkboard.• PresstheCLOSEbutton.• TheDigisparkboardsarenowlistedatTOOLS,BOARD.• Duringthisprocess,allnecessarylibrariesandsomeexamplesketchesarealsomadeavailableinArduinoIDE.• Ifyouareusingversion2.0a4oftheDigistumpboardpluginonaMac,you'llneedtochangesomesettingsfor2files.Todothis,typethefollowingcommandsinaTerminalwindow.cd cd Library/Arduino15/packages/digistump/tools/micronucleus/2.0a4/ chmod +x launcher chmod +x micronucleus Progr mmingtheAttiny85Digisp rk o rd• ChooseTOOLS,BOARD,DIGISPARK(DEFAULT16,5MHz).• ChooseTOOLS,PROGRAMMER,USBTINYISP.• DisconnectyourAttiny85Digisparkboardfromyourcomputer.• PresstheUPLOADbuttontouploadyoursketch,waituntilyouseethemessage:RunningDigisparkUploader...Plugindevicenow...(willtimeoutin60seconds)• NowyoucanconnectyourAttinyDigisparkboardtoyourcomputer.Theboardwillbedetectedautomaticallyandthesketchwillbeuploaded.running:100%complete>>Micronucleusdone.Thankyou!S mplesketchAttiny85Digisp rk o rdvoid setup() { pinMode(1, OUTPUT); } void loop() { digitalWrite(1, HIGH); delay(2000); digitalWrite(1, LOW); delay(2000); }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.12810. ESP8266MCUTheESP8266isatiny,cheapandpowerfullMCU,itcanbeprogrammedlikeanArduinoinC++,withLuaandwithPython.MoredetailscanbefoundintheESP8266section.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.129Softw reThissectiondescribesArduinoIDE,thesoftwareyouneedtoprogramyourArduino,butalsootherapplicationslikeProcessingtocommunicatewithyourcomputerandFritzingtomakeelectronicdrawings.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13011. ArduinoIDEToedit,compileanduploadsoftwareprojects(sketches)fromyourcomputer,youneedatleasttheArduinoIDE.Twootherpeace'sofsoftwarearealsorecommended,i.e.ProcessingfortheconnectionbetweenyourArduinoprojectsandyourcomputerandFritzingtocreatedrawings.ThischapterdescribestheArduinoIDE,ProcessingandFritzingaredescribedinthefollowingchapters.11.1. ArduinoIDEsoftw reWiththisArduinoIntegratedDevelopmentEnvironmentyoucanedit,compileanduploadArduinosketchestotheArduinoboards.InthisdocumentIrefertoversion1.6.5,availableforWindows,OSXandLinux(andanolderversionforRaspberryPi).Pict.1Sampleofthesketch"BareMinimum"11.2. LinksforArduino• Homepagehttp://arduino.cc/• Tutorialshttp://arduino.cc/en/Guide/HomePagehttp://arduino.cc/en/Tutorial/HomePage• Referencehttp://arduino.cc/en/Reference/HomePage• DownloadIDE:https://www.arduino.cc/en/Main/Software• Drivers:http://www.ftdichip.com/Drivers/VCP.htm

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13111.3. Gettingst rtedwithArduinoIDEStructureArduinoSketches// Put the inclusions of libraries, declaration of constants // and declaration and initializing of variables here void setup() { // Put your setup code here, to run once: } void loop() { // Put your main code here, to run repeatedly: // The loop never ends!. Quiting the loop is performed // by turning off the power to the Arduino board. } // Put the declaration of functions and procedures here S mplewritingtoSeri lportvoid setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println("Start of serial communication"); } void loop() { // put your main code here, to run repeatedly: Serial.println("Hello World"); }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13212. ProcessingProcessingisaprogramminglanguage,developmentenvironmenttargetedtovisualarts.ItcaneasilyconnectwithyourArduinoprojectthroughtheSerialport(throughUSB).Forexample,youcanuseyourArduinotoreadthepositionofajoystickandsendthistoProcessingtomakeacubeturnaround.12.1. LinksforProcessing• Homepagehttp://www.processing.org/• Tutorialshttp://www.processing.org/tutorials/http://www.processing.org/examples/• Referencehttp://www.processing.org/reference/• DownloadforWindows32/64bit:http://download.processing.org/processing-2.1-windows32.ziphttp://download.processing.org/processing-2.1-windows64.zip• DownloadforOSX:http://download.processing.org/processing-2.1-macosx.zip• DownloadforLinux32/64bit:http://download.processing.org/processing-2.1-linux32.tgzhttp://download.processing.org/processing-2.1-linux64.tgz

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13312.2. ListSeri lPortsWhenusingProcessingtocommunicatewithanArduinoboard,youneedtodeterminethenameoftheserialportthroughwhichtheArduinoisconnectedtothecomputer.ThefollowingProcessingsketchcanbeusedtoshowallavailableserialportsandalldatacominginthroughonespecificport.Processingsketchimport processing.serial.*; Serial myArduino; int myArduinoPort=11; void setup() { String[] ports= Serial.list(); if(ports.length <1) { println("Sorry, there is no serial port available."); } else { for (int count=0;count < ports.length; count++) { println("Use Serial.list()[" + count + "] when connecting to " + ports[count]); } } // Load a test sketch in your Arduino to produce serial data, // match the baudrate // Put the portnumber you want to test in Serial.list()[..] and // watch the monitor below. println("\nTrying to connect to Serial.list()[" + myArduinoPort + "]"); println(" =" + ports[myArduinoPort] + " \n"); myArduino = new Serial(this, Serial.list()[myArduinoPort], 9600); } void draw() { while (myArduino.available() > 0) { char inByte = char(myArduino.read()); print(inByte); } } ThefollowingArduinosketchprintstheletterAtotheserialport.void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: Serial.print("A"); delay(500); }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13513. FritzingFritzingisatoolyoucanusetocreatedrawingsofyourArduinoprojects.InFritzingyoucandrawinthreedifferentenvironments:Breadboard,SchematicandPCB.Youcanswitchbetweenthesethreeenvironmentsatwill.YoucanuseFritzingtodocumentyourprojects,checkyourdesign,routetheconnectionsonabreadboardorcreateaPCB(PrintedCircuitBoard)tobuildyourownArduinoshield.FritzingisnotlimitedtoArduino.Pict.3Blink-example(fromlefttoright,Breadboard,SchematicandPCBdesign)AlldrawingsusedintheArduinotutorialsatarduino.ccandalldrawingsinthisdocumenthavebeencreatedbyFritzing.InthisdocumentIreferto0.8.5,availableforWindows,OSXandLinux.13.1. LinksforFritzing• Homepage:http://fritzing.org• Tutorials:http://fritzing.org/learning/• Reference:http://fritzing.org/learning/full_reference• DownloadforWindows:http://fritzing.org/download/0.8.5b/windows/fritzing.2013.12.17.pc.zip• DownloadforOSX:http://fritzing.org/download/0.8.5b/mac-os-x-105/fritzing.2013.12.17.cocoa.dmg• Linux32/64bit:http://fritzing.org/download/0.8.5b/linux-32bit/fritzing-0.8.5b.linux.i386.tar.bz2http://fritzing.org/download/0.8.5b/linux-64bit/fritzing-0.8.5b.linux.AMD64.tar.bz2• Customparts:https://code.google.com/p/fritzing/issues/detail?id=875

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.136Progr mming/Progr mmersTherearedifferentwaystoprogramanArduinoboardoranotherAVRMCU,usingdifferenttechniques(programming)orequipment(programmers).InmostsituationsyouwillprogramanArduinoboardthroughtheonboardUSBconnector,butsomeboardslackthisconnector.Thischapterdescribesdifferentprogrammingtechniquesanddifferentprogrammers.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13714. Progr mming nArduinoBo rdthroughUSBThisisthedefaultwaytoprogramasketchtoanArduinoBoard.Progr mming sketchs mple• ConnectyourArduinotoyourcomputerusinganUSBcable.• Loadthesketchyouwanttocompileandupload.• ChooseTOOLS,BOARD,thenselectthecorrectArduinoboard.• ChooseTOOLS,PROGRAMMER,AVRISPmkll.• ChooseTOOLS,SERIALPORT,thenselectthecorrectSerialPort• ChooseFILE,UPLOAD.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.13815. USB spv2.0progr mmer15.1. LinksUSB spv2.0progr mmer• DriversWindows(noneneededforLinuxorMacOSx):http://www.fischl.de/usbasp/usbasp-windriver.2011-05-28.zip• SoftwareAVRDUDEhttp://download.savannah.gnu.org/releases/avrdude/• Documentationandfirmware:http://www.fischl.de/usbasp/• http://www.fischl.de/usbasp/Readme.txt15.2. ConnectionsUSB spv2.0progr mmerMISOSCKRSTNCMOSI97531108642GNDGNDGNDGNDVCCJ1Power,choosebetween3.3and5V.J2Firmwareupgrade(withanotherprogrammer).J3SCK,either375kHzor8kHz(incasetargetclockislowerthan1.5MHz).15.3. S mpleSetupUSB spv2.0progr mmer1• Connect9MISOtoD12.• Connect7SCKtoD13.• Connect5RSTtoRESET• Connect1MOSItoD11.• ConnectVCCto5V.• ConnectGNDtoGND.1ThissetupcanbesimplifiedbyusinganAVRISPtoICSPadapterasdescribedinthenextchapter.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.139Progr mming new ootlo ders mpleThefollowingstepscanbeusedtoprogramanewbootloadertoanArduinoUNOboard.Thisisneededwhenthebootloaderiscorrupt,orwhenadestroyedAtmega328hasbeenreplacedwithanewone.• ChooseTOOLS,PROGRAMMER,USBasp.• ChooseTOOLS,BOARD,ARDUINOUNO.• ChooseTOOLS,BURNBOOTLOADER.Progr mming sketchs mpleTheUSBaspcanalsobeusedtoprogramasketchtoanArduinoBoard.• Loadthesketchyouwanttocompileandupload.• ChooseTOOLS,PROGRAMMER,USBasp.• ChooseTOOLS,BOARD,ARDUINOUNO.• ChooseFILE,UPLOADUSINGPROGRAMMER.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14016. AVRISPtoICSPAd pterWiththisAVRISPtoICSPadapteryoucandirectlyconnectanUSBaspprogrammer(seepreviouschapter)withtheICSPconnectoronanArduinoboard.16.1. ConnectionsAVRISPtoICSPAd pterMISOSCKRSTNCMOSI97531108642GNDGNDGNDGNDVCCMISOSCKRSTVCCMOSIGND16.2. S mpleSetupUSBASPv2.0progr mmerThefollowingsetupisasimplifiedversionofthesetupofthepreviouschapter.• ConnectUSBasptoaUSBport.• ConnectAVRISPtoICSPadapterwithaflatcabletotheUSBasp.• ConnectotherendoftheAVRISPtoICSPadaptertotheICSPheadersontheArduinoUNO(withtheGNDpinfacingtheAtmega328).Progr mming new ootlo ders mpleThefollowingstepscanbeusedtoprogramanewbootloadertoanArduinoUNOboard.Thisisneededwhenthebootloaderiscorrupt,orwhenadestroyedAtmega328hasbeenreplacedwithanewone.• ChooseTOOLS,PROGRAMMER,USBasp.• ChooseTOOLS,BOARD,ARDUINOUNO.• ChooseTOOLS,BURNBOOTLOADER.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.141Progr mming sketchs mpleTheUSBaspcanalsobeusedtoprogramasketchtoanArduinoBoard.• Loadthesketchyouwanttocompileandupload.• ChooseTOOLS,PROGRAMMER,USBasp.• ChooseTOOLS,BOARD,ARDUINOUNO.• ChooseFILE,UPLOADUSINGPROGRAMMER.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14217. Uplo dingthe ootlo der yusing nArduino sISPProgramminganArduinoistakencareofbyasmallroutinecalledthebootloader.ThebootloaderislocatedontheATMEGA328PchipontheArduino.Sometimesitisnecessarytouploadanewbootloadertothischip.Thischapterdescribesonewaytodothis.YouneedtwoArduino'sanda10uFcapacitor.OneoftheseArduino'smusthaveacorrectworkingbootloader.ThisworkingArduinowillbeservingasanAVRISP(in-systemprogrammer).Moreinformationcanbefoundathttps://www.arduino.cc/en/Tutorial/ArduinoISP17.1. S mpleArduino sISPFollowthefollowingsteps:• ConnectthecorrectworkingArduinotoyourcomputer.• OpentheArduinoISPsketch(inexamples).• ConnectyourArduinotoyourcomputerusinganUSBcable.• ChooseTOOLS,BOARD,thenselectthecorrectArduinoboard.• ChooseTOOLS,PROGRAMMER,AVRISPmkll.• ChooseTOOLS,SERIALPORT,thenselectthecorrectSerialPort.• ChooseFILE,UPLOAD.• AtthispointyourcorrectworkingArduinowillserveasanAVRISP.• Makethefollowingconnectionsbetweenyourworkingandnon-workingArduino.WorkingArduinoNonWorkingArduinoD13D13D12D12D11D11D10RESET5V5VGNDGND• OnthecorrectworkingArduino,connecta10uFcapacitorbetweenRESETANDGND(youcouldtryitwithout).• KeeptheworkingArduinoconnectedtoyourcomputer.• ChooseTOOLS,BOARD,thenselecttheNON-WORKINGArduinoboard.• ChooseTOOLS,PROGRAMMER,ARDUINOASISP• ChooseBURNBOOTLOADER.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14318. AVRAtmeg 8/168/328Development o rdWiththisdevelopmentboardyoucanprogramAtmega8,Atmega168andAtmega328MCU'sthroughthe10pinsISPconnector.YoucanalsouseitasanArduinoBoardwithoutanUART(i.e.withoutaserialconnectionthroughUSB).UsethelayoutbelowtomatchtheAtmega328toArduinopinassignment.18.1. ConnectionsAVRAtmeg 8/168/328Development o rd

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14418.2. S mplesetupAVRAtmeg 8/168/328Development o rd• Replace8MHzcrystalwith16MHz.• PlaceAtmega328inZIF-socket.• ConnectflatcablebetweenUSBAspandDevelopmentboard.Progr mming new ootlo derThefollowingstepscanbeusedtoprogramanewArduinoUNObootloadertoanAtmega328.• ChooseTOOLS,PROGRAMMER,USBasp.• ChooseTOOLS,BOARD,ARDUINOUNO.• ChooseTOOLS,BURNBOOTLOADER.Progr mming sketchs mple• Loadthesketchyouwanttocompileandupload.• ChooseTOOLS,PROGRAMMER,USBasp.• ChooseTOOLS,BOARD,ARDUINOUNO.• ChooseFILE,UPLOADUSINGPROGRAMMER.SometimesitisneededtodisconnectandreconnecttheUSBasponyourUSBport,otherwisetheArduinoIDEwillendopwithAVRdudeerrors.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14519. Self-m deAttiny45/85ISP d pterAself-madeAttiny45/85-ISPadaptercableonapieceofbreadboard.19.1. ConnectionsSelf-m deAttiny45/85ISP d pter19.2. S mpleProgr mming Attiny45PlacetheAttinyonasolderlessbreadboard,placethedoublerowofheaderpinsoftheAttiny45/85adapteronthesolderlessbreadboardwithpin1alignedwithpin1oftheAttiny.Connectthe10pinsfemaleconnectorintheISPconnectorofanUSBasp1.• OpentheBlinksketchfromFILE/EXAMPLES(changepin13to0,thatispin5ontheAttiny).• ChooseTOOLS/BOARD/Attiny45internal8MHz• ChooseTOOLS/PROGRAMMER/USBasp.• UploadtheBlinksketchtotheAttiny,bychoosingFILE/UPLOADUSINGPROGRAMMER.Ignoretheerrorslikethis"avrdude:pleasedefinePAGELandBS2signalsintheconfigurationfileforpartAttiny".• ConnectaLEDandcurrentlimitingresistorof220ohmbetweenpin5andGND(seechapteraboutLED).TheLEDshouldblink1secondon,1secondoff.1YoumightalsousetheISP-ICSPadaptertoconnecttheAttinytotheICSPofanArduinoboard(nottestedyet).TheArduinoshouldthenbeloadedwiththeArduinoISPsketch.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14720. BuzzerAbuzzerisatinyspeakerthatcanonlyproducealoudbuzzingsound.Playingnotesisnotpossible(useapiezospeakerinstead).20.1. Specific tionsBuzzer• Voltage:3.5-5.5V• Frequency:2300Hz20.2. ConnectionsBuzzerPinnrNameDescriptionArduinopin1+SignalAnydigitalport2-GroundGND20.3. Li r riesneededforBuzzerNoneneeded.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14820.4. S mpleBuzzerThefollowingsketchplaysthemaydaysignalS.O.S.S mpleConnections• Connect+toD8.• Connect-toGND.S mpleSketchint speakerPin = 8; int shortnote = 50; int longnote = 200; int interpunction = 200; void playLetterO() { for (int i = 1; i <=3; i++) { digitalWrite(speakerPin, HIGH); delay(longnote); digitalWrite(speakerPin, LOW); delay(longnote); } delay(interpunction); } void playLetterS() { for (int i = 1; i <=3; i++) { digitalWrite(speakerPin, HIGH); delay(shortnote); digitalWrite(speakerPin, LOW); delay(shortnote); } delay(interpunction); } void setup() { pinMode(speakerPin, OUTPUT); } void loop() { playLetterS(); playLetterO(); playLetterS(); delay(1000); }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.14921. PiezoSpe kerApiezospeakerisatinyspeakerthatisoftenusedintoys.21.1. Specific tionsPiezoSpe ker21.2. ConnectionsPiezoSpe kerPinnrNameDescriptionArduinopin1+SignalAnyPWMport2-GroundGND21.3. Li r riesneededforPiezoSpe kerNoneneeded.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15021.4. S mplePiezoSpe kerThefollowingsketchplaysasimplemelody.S mpleConnections• Connect+toD9.• Connect-toGND.S mpleSketchint speakerPin = 9; int length = 15; // the number of notes char notes[] = "ccggaagffeeddc "; // a space represents a rest int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 }; int tempo = 300; void playTone(int tone, int duration) { for (long i = 0; i < duration * 1000L; i += tone * 2) { digitalWrite(speakerPin, HIGH); delayMicroseconds(tone); digitalWrite(speakerPin, LOW); delayMicroseconds(tone); } } void playNote(char note, int duration) { char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' }; int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 }; // play the tone corresponding to the note name for (int i = 0; i < 8; i++) { if (names[i] == note) { playTone(tones[i], duration); } } } void setup() { pinMode(speakerPin, OUTPUT); } void loop() { for (int i = 0; i < length; i++) { if (notes[i] == ' ') { delay(beats[i] * tempo); // rest } else { playNote(notes[i], beats[i] * tempo); } // pause between notes delay(tempo / 2); } }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.151LED(displ ys)InthissectionyouwillfindseveralcomponentsusingLED's,R-BLED's,a8x8LEDmatrixand7SegmentDigits.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15222. On o rdLEDD1322.1. Specific tionsOn o rdLEDD13• Onboard,connectedtoD13.22.2. ConnectionsOn o rdLEDD13Noconnectionsneeded,sincethisledisalreadysolderedontheArduinoboardandconnectedtoD13.22.3. Li r riesneededforOn o rdLEDD13Noneneeded.22.4. S mpleOn o rdLEDD13S mpleConnections• Noconnectionsneeded.S mpleSketchint led = 13; void setup() { pinMode(led, OUTPUT); } void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15323. LEDLEDcomesfromLightEmittingDiode.ADiodeisadevicethatwillonlyallowcurrentinonedirection.IfthiscurrentrunsthroughaLEDthenitwillemitlight.23.1. Specific tionsLEDMostLEDhaveamaximumallowedVoltageof1.8-2.0VandamaximumallowedCurrentof20mA.TheoutputVoltageofanArduinois5VandthiswouldfryyourLED.TopreventyourLED'sfromfrying,alimitingresistorisneeded.Inmostcasearesistorof220ohmshoulddothetrick.OnesideofaLEDiscalledtheAnodeandshouldbeconnectedtoaDigitaloutputthroughalimitingresistorof220ohm1.TheothersideiscalledtheCathodeandshouldbeconnectedtoGND.ThereareseveralwaysyoucandistinguishtheAnodefromtheCathode:• TheAnode(+)hasthelongestleg.• TheCathode(-)hasaflatedge.• InsidetheLEDtheCathodeisconnectedtosomethingthatlookslikeacup.• Lastresort,connecttheLEDandtryitout.IftheLEDwon'tlid,youhavetoturnitaround!1WithanaverageIr=20mAandVr=1.8V,thisvaluecanbecalculatedwiththecalculatoronthefollowingwebsite:http://led.linear1.org/1led.wiz

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15423.2. ConnectionsLEDPinnrNameDescriptionArduinopin1CathodeshortestlegflatedgeGND2AnodelongestlegroundededgeAnyDigitalportthrough220ohmresistor23.3. Li r riesneededforLEDNoneneeded.23.4. S mpleLEDS mpleConnections• ConnectCathodewithGND.• ConnectAnodewithoneendofaResistorof220Ohm.• ConnectotherendoftheResistorwithD10.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.155S mpleSketchusingdigit lWrite()InthissketchtheLEDisblinking.TheLEDiseitherOnorOFFint led = 10; void setup() { pinMode(led, OUTPUT); } void loop() { digitalWrite(led, HIGH; delay(1000); digitalWrite(led, LOW); delay(1000); } S mpleSketchusing n logWrite()(PWM)InthissketchtheLEDisfadingonandOFF,byusinganalogWrite()ononeofthePWMports.int led = 10; int brightness = 0; int fadeAmount = 5; void setup() { pinMode(led, OUTPUT); } void loop() { analogWrite(led, brightness); brightness = brightness + fadeAmount; if (brightness == 0 || brightness == 255) { fadeAmount = -fadeAmount; } delay(10); }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15624. RGBLED o rdARGBLEDislike3LEDSinone,RED,GREENandBLUE.BymixingthesethreecolorsyoucanalsocreatecolorsinbetweenlikeYELLOW,MAGENTAandCYAN.24.1. Specific tionsRGBLED o rdThisRGBLEDboardfromXindacontains1RGBLEDandthreecurrentlimitingresistorssoitcanbeconnecteddirectlytotheoutputportsofyourArduino.ItshasacommonCathode.24.2. ConnectionsRGBLED o rdPinnrNameDescriptionArduinopin1BBlueAnyPWMport2GGreenAnyPWMport3RRedAnyPWMport4-24.3. Li r riesneededforRGBLED o rdNoneneeded.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15724.4. S mpleRGBLED o rdThefollowingsketchchangesthecoloroftheRGBledcontinuously.S mpleConnections• ConnectBtoD9.• ConnectGtoD10.• ConnectRtoD11.• ConnectGNDtoGND.S mpleSketchint RGBred = 11; int RGBgreen = 10; int RGBblue = 9; void setup() { pinMode(RGBred, OUTPUT); pinMode(RGBgreen, OUTPUT); pinMode(RGBblue, OUTPUT); } void loop() { for (int redvalue=0;redvalue <=255;redvalue=redvalue+255) { for (int greenvalue=0;greenvalue <=255;greenvalue=greenvalue+255) { for (int bluevalue=0;bluevalue <=255;bluevalue=bluevalue+255) { RGB(redvalue,greenvalue,bluevalue); delay(500); } } } } void RGB(int red, int green, int blue) { analogWrite(RGBred, red); analogWrite(RGBgreen, green); analogWrite(RGBblue, blue); }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15825. 8x8DOTM trix1088ASThis8x8DOTMatrixisusedinchapter"278x8DOTmatrixwithMAX7219chip".25.1. Specific tions8x8DOTM trix1088AS• 64REDLED's3mm.• RowCathode• ColumnAnode25.2. Connections8x8DOTM trix1088ASPinnrRowColumn1CathodeRow52CathodeRow73AnodeColumn24AnodeColumn35CathodeRow86AnodeColumn57CathodeRow68CathodeRow39CathodeRow110AnodeColumn411AnodeColumn612CathodeRow413AnodeColumn114CathodeRow215AnodeColumn716AnodeColumn825.3. Li r riesneededfor8x8DOTM trix1088ASNoneneeded.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.15925.4. S mple8x8DOTM trix1088ASTodriveeveryLEDinthismatrixindividuallywithoutusinganychips,youwillneed16digitalports.ThisisonlypossiblewiththeArduinoMega.Thissketchwilldriveawholecolumnatatime.1S mpleConnections• Connect1,2,5,7,8,9,12and14tooneendofa220ohmresistoreach.• Connecttheotherendsofthe8resistorstoGND.• Connect13(Row1)toD6• Connect3(Row2)toD7• Connect4(Row3)toD8• Connect10(Row4)toD9• Connect6(Row5)toD10• Connect11(Row6)toD11• Connect15(Row7)toD12• Connect16(Row8)toD13S mpleSketchvoid setup() { for (int rownr=6;rownr<=13;rownr++) { pinMode(rownr,OUTPUT); digitalWrite(rownr,LOW); } } void loop() { for (int rownr=6;rownr<=13;rownr++) { digitalWrite(rownr,HIGH); delay(200); digitalWrite(rownr,LOW); } } 1IfyouwanttodriveeveryLEDindividually,you'lneedsomeextraIC's,MAX7219or2shift-registers(74HC595)andsometransistorstodelivermorecurrent.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16026. 8x8DOTM trix1388ASRInthisDOTmatrixtherowsareconnectedtotheAnodesandthecolumnstotheCathodes,sothisDOTmatrixcannot(easily)replacetheDOTmatrixontheboardthatwasdescribedin"278x8DOTmatrixwithMAX7219chip".26.1. Specific tions8x8DOTM trix1388ASR• 64REDLED's3mm.• RowAnode• ColumnCathode• Vf=1.8• If=20mA.26.2. D t sheet8x8DOTM trix1388ASRhttp://www.alfacomponent.com/r_rayconn/index_2.files/PDF/MATRIX/REC-M1388ASR.pdf26.3. Connections8x8DOTM trix1388ASRPinnrRowColumn1AnodeRow52AnodeRow73CathodeColumn24CathodeColumn35AnodeRow86CathodeColumn57AnodeRow68AnodeRow39AnodeRow110CathodeColumn411CathodeColumn612AnodeRow4

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.161PinnrRowColumn13CathodeColumn114AnodeRow215CathodeColumn716CathodeColumn826.4. Li r riesneededfor8x8DOTM trix1388ASRNoneneeded.26.5. S mple8x8DOTM trix1388ASRTodriveeveryLEDinthismatrixindividuallywithoutusinganychips,youwillneed16digitalports.ThisisonlypossiblewiththeArduinoMega.Thissketchwilldriveawholerowatatime.S mpleConnections• Connect3,4,6,10,11,13,15and16tooneendofa220ohmresistoreach.• Connecttheotherendsofthe8resistorstoGND.• Connect9(Row1)toD6• Connect14(Row2)toD7• Connect8(Row3)toD8• Connect12(Row4)toD9• Connect1(Row5)toD10• Connect7(Row6)toD11• Connect2(Row7)toD12• Connect5(Row8)toD13S mpleSketchvoid setup() { for (int rownr=6;rownr<=13;rownr++) { pinMode(rownr,OUTPUT); digitalWrite(rownr,LOW); } } void loop() { for (int rownr=6;rownr<=13;rownr++) { digitalWrite(rownr,HIGH); delay(200); digitalWrite(rownr,LOW); } }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16227. 8x8DOTm trixwithMAX7219chipThis8x8DOTmatrixcanbeusedasasimpledisplay,orcombinedwithotherstobuildalargerdisplay.ThesingleLED'sinthesesingle/multipleDOTMatrixdisplayscanbeindividuallyaddressedbyaserialprotocol,thusminimizingthenumberofoutputpinsneededinyourproject.Besidetheuseofthe5VandGNDpinyouonlyneed3digitaloutputpins,insteadofoneforeverycolumnsorrow..27.1. Specific tions8x8DOTM trixwithMAX7219chip• MAX7219LEDdisplaydriverfromMaxim• 1088AS8x8DOTmatrix.• 5pinheaderrowforinputfromMCUorpreviousmodule.• 5pinheaderrowforoutputtonextmodule,• SeriallyaddressedthroughSerialPeripheralInterface:SPI(http://arduino.cc/en/Reference/SPI).27.2. D t sheetMAX7219:Seri llyInterf ced,8-DigitLEDDispl yDrivershttp://pdf1.alldatasheet.com/datasheet-pdf/view/73745/MAXIM/MAX7219.html27.3. Connections8x8DOTM trixwithMAX7219chipAfterpurchase,thecomponentsneedtobesolderedonthelabeledside.PrintedlabelonsideoftheLEDMatrixshouldbeplacedoppositetothenotchontheMAX7219chip(seepictureabove).Multiplemodulescanbedaisychainedbyconnectingthe5pinhe der t ottom(input)PinnrNameDescriptionArduinopin1VCC5V5V2GNDGroundGND3DINDatainMOSI(D11)4CSChipSelectAnyDigitalport5CLKClockSCK(D13)

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.1635pinhe der ttop(outputtootherDOTm trixmodules)PinnrNameDescriptionNextmodule1VCC5VVCC2GNDGroundGND3DOUTDataoutDIN4CSChipSelectDS5CLKClockCLK

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16427.4. Li r riesneededfor8x8DOTM trixwithMAX7219chipI'vebeenusingthefollowing3libraries• SerialPeripheralInterfacelibraryincludedintheArduinoIDE.• Max72xxPaneltoaddresstheMax7219LEDdisplaydriver.CreatedbyMarkRuys(mark@paracas.nl)https://github.com/markruys/arduino-Max72xxPanel• AdafruitGFXtocreategraphicsonallsortsofdisplays.CreatedbyAdafruit.https://github.com/adafruit/Adafruit-GFX-LibraryLi r ryuseexpl n tion#include Include the Serial Peripheral Interface included in the Arduino IDE. #include Include the display library from Adafruit. #include Include the MAX 72xxPanel library from Mark Ruys (mark@paracas.nl). Max72xxPanel mymatrix = Max72xxPanel(CS, 1, 1); Create 'mymatrix' a new instance of the object type Max72xxPanel. CS is an Integer value corresponding to the Arduino Digital Output to which CS pin is connected. mymatrix.fillScreen(LOW); Turn of all pixel in mymatrix's buffer. mymatrix.write(); Showing content of mymatrix's buffer on the DOT matrix. In this case, all LED's are turned of. This function should be called every time a change in mymatrix's buffer needs to be showed in the DOT Matrix. mymatrix.drawPixel(4, 4, HIGH); Turn on pixel 4, 4 in mymatrix's buffer. mymatrix.write(); Showing content of mymatrix's buffer on the DOT matrix. In this case, LED 4,4 is turned on. Aswithotherlibraries,informationaboutothermethods(functions)youcanuse,canbefoundinthecorrespondinglibraryheaderfiles*.hinthelibraryfolders.MoreinformationontheuseoftheAdafruit_GFXlibrarycanbefindatthefollowingURL:http://learn.adafruit.com/adafruit-gfx-graphics-library?view=all

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16527.5. S mple8x8DOTM trixwithMAX7219chipThissamplesketchshowsadottravelingfromrowtorowandfromcolumntocolumn.S mpleConnections• ConnectVCCwith5V.• ConnectGNDwithGND.• ConnectDINwithMOSI(D11).• ConnectCSwithD10.• ConnectCLKwithSCK(D13).S mpleSketch#include #include #include int pinCS = 10; Max72xxPanel matrix = Max72xxPanel(pinCS, 1, 1); int wait = 100; // In milliseconds void setup() { matrix.fillScreen(LOW); matrix.write(); } void loop() { for (int county=0;county

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16628. SingleDigit7-SegmentDispl yThisSingleDigitdisplayhas7segmentsand1decimalpoint.28.1. Specific tionsSingleDigit7-SegmentDispl y• 1Digitwith7SegmentsA..Gand1DecimalPoint.• Commoncathode(2pins).• 8Digitalpinsneeded.• 8limitingresistorsneeded(1perSegmentand1forthedecimalpoint).28.2. D t sheetHS120561KSingleDigit7-SegmentDispl yhttp://www.aplomb.nl/Niels_skn/7-Segment_QRD%20Niels.pdf,page13.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16728.3. ConnectionsSingleDigit7-SegmentDispl yPinnrNameDescriptionArduinopin1EE-segmentD6througha220ohmresistor2DD-segmentD5througha220ohmresistor3CathodecommoncathodeGND4CC-segmentD4througha220ohmresistor5DPDecimalPointD9througha220ohmresistor6BB-segmentD3througha220ohmresistor7AA-segmentD2througha220ohmresistor8CathodecommoncathodeGND9FF-segmentD7througha220ohmresistor10GG-segmentD8througha220ohmresistor

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16828.4. Li r riesneededforSingleDigit7-SegmentDispl y• Noneneeded.Expl n tionThefollowingtableshowswhichsegmentneedstobeswitchedonforeverynumber.NrABCDEF-0ONONONONONONOFF1OFFONONOFFOFFOFFOFF2ONONOFFONONOFFON3ONONONONOFFOFFON4OFFONONOFFOFFONON5ONOFFONONOFFONON6ONOFFONONONONON7ONONONOFFOFFOFFOFF8ONONONONONONON9ONONONOFFOFFONONhttp://www.hacktronics.com/Tutorials/arduino-and-7-segment-led.html

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.16928.5. S mpleSingleDigit7-SegmentDispl yThefollowingsketchcountsdownfrom9to0repeatedly.S mpleConnections• Connect3and8toGND.• Connectoneendofa220ohmresistortopin1andtheotherendtoD6.• Connectoneendofa220ohmresistortopin2andtheotherendtoD5.• Connectoneendofa220ohmresistortopin4andtheotherendtoD4.• Connectoneendofa220ohmresistortopin5andtheotherendtoD9.• Connectoneendofa220ohmresistortopin6andtheotherendtoD3.• Connectoneendofa220ohmresistortopin7andtheotherendtoD2.• Connectoneendofa220ohmresistortopin9andtheotherendtoD7.• Connectoneendofa220ohmresistortopin10andtheotherendtoD8.S mpleSketchbyte seven_seg_digits[10][7] = { { 1,1,1,1,1,1,0 }, // = 0 { 0,1,1,0,0,0,0 }, // = 1 { 1,1,0,1,1,0,1 }, // = 2 { 1,1,1,1,0,0,1 }, // = 3 { 0,1,1,0,0,1,1 }, // = 4 { 1,0,1,1,0,1,1 }, // = 5 { 1,0,1,1,1,1,1 }, // = 6 { 1,1,1,0,0,0,0 }, // = 7 { 1,1,1,1,1,1,1 }, // = 8 { 1,1,1,0,0,1,1 } // = 9 }; void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); writeDot(1); } void writeDot(byte dot) { digitalWrite(9, dot); } void sevenSegWrite(byte digit) { byte pin = 2; for (byte segCount = 0;segCount < 7;++segCount) { digitalWrite(pin, seven_seg_digits[digit][segCount]); ++pin; } }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.170void loop() { for (byte count = 10;count > 0;--count) { delay(1000); sevenSegWrite(count - 1); } }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.17129. 4Digits7-SegmentDispl yThis4Digitsdisplayhas7segmentsand1decimalpointperdigit.29.1. Specific tions4Digits7-SegmentDispl y• 4digits,with7SegmentsA..Gand1DecimalPointperdigit.• Commoncathode.• 1Selectpinperdigit.• 4limitingresistorsneeded,1foreveryselectpin.• Totalof12Digitalpinsneeded.29.2. D t sheetHS420561KSingleDigit7-SegmentDispl yhttp://www.aplomb.nl/Niels_skn/7-Segment_QRD%20Niels.pdf,page35.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.17229.3. Connections4Digits7-SegmentDispl yPinnrNameDescriptionArduinopin1ESegmentED102DSegmentDD93DPDecimalPointD134CSegmentCD85GSegmentGD126Digit4CommoncathodeforDigit4D5througha220ohmresistor7BSegmentBD78Digit3CommoncathodeforDigit3D4througha220ohmresistor9Digit2CommoncathodeforDigit2D3througha220ohmresistor10FSegmentFD1111ASegmentAD612Digit1CommoncathodeforDigit1D2througha220ohmresistor

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.17329.4. Li r riesneededfor4Digits7-SegmentDispl y• SevenSegmentDisplayLibraryfromDeanReadingdeanreading@hotmail.com.http://playground.arduino.cc/Main/SevenSegmentLibraryLi r ryuseexpl n tion#include "SevSeg.h" Include the Seven Segment library from Dean Reading. SevSeg mysevseg; Create a new instance of the object SevSeg. mysevseg.Begin(CA,D1pin,D2pin,D3pin,D4pin,A,B,C,D,E,F,G,DP); CA is a Boolean: 1 for common Anode, 0 for common Cathode. D1pin..DP are integer values for the digital pins to which D1pin..DP are connected to (probably 2..13). mysevseg.Brightness(100); Set brightness to 100 (0-100). mysevseg.PrintOutput(); .PrintOutput() must be called repeatedly to get the number displayed (refresh??). mysevseg.NewNum(CentSec,(byte) 2); .NewNum displays the number on your display. Aswithotherlibraries,informationaboutothermethods(functions)youcanuse,canbefoundinthecorrespondinglibraryheaderfiles*.hinthelibraryfolders.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.17429.5. S mple4Digits7-SegmentDispl yThefollowingsketchcountsfrom0.00to99.99secondsrepeatedly.S mpleConnections• ConnectVCCto5V.• ConnectGNDtoGND.• Connectoneendofa220ohmresistortopin1(Digit1)andtheotherendtoD2.• Connectpin2(A)toD3.• Connectpin3(F)toD3.• Connectoneendofa220ohmresistortopin4(Digit2)andtheotherendtoD5.• Connectoneendofa220ohmresistortopin5(Digit3)andtheotherendtoD6.• Connectpin6(B)toD3.• Connectpin7(E)toD3.• Connectpin8(D)toD3.• Connectpin9(DP)toD3.• Connectpin10(C)toD3.• Connectpin11(G)toD3.• Connectoneendofa220ohmresistortopin12(Digit4)andtheotherendtoD13.S mpleSketch#include "SevSeg.h" SevSeg sevseg; unsigned long timer; int CentSec=0; void setup() { sevseg.Begin(0,2,3,4,5,6,7,8,9,10,11,12,13); sevseg.Brightness(100); timer=millis(); } void loop() { sevseg.PrintOutput(); //Check if 10ms has elapsed unsigned long mils=millis(); if (mils-timer>=10) { timer=mils; CentSec++; if (CentSec==10000) { // Reset to 0 after counting for 100 seconds. CentSec=0; } sevseg.NewNum(CentSec,(byte) 2); } } http://www.hacktronics.com/Tutorials/arduino-and-7-segment-led.html

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.17530. 8Digits7-SegmentDispl ywithTM1638chip8Digits7SEGdisplay30.1. Specific tions8Digits7-SegmentDispl ywithTM1638chip• TM1638controllerchip.• 8Digitsof8LEDs.• Onlythreedigitalportsneededforone8x8SEGdisplay(1extraforeveryadditional8x8SEGdisplay).30.2. D t sheetTM1638chip• http://dl.dropboxusercontent.com/u/8663580/TM1638English%20version.pdf30.3. Connections8Digits7-SegmentDispl ywithTM1638chipInput2x5pinhe derPinnrNameDescriptionArduinopin1VCC5V5V2GNDGroundGND3CLKClockAnyDigitalport4DIODatainAnyDigitalport5STB0Strobe0(thisdisplaymodule)AnyDigitalport6STB1Strobe1(nextdisplaymodule)AnyDigitalport7STB2Strobe2(nextdisplaymodule+1)AnyDigitalport8STB3Strobe3(nextdisplaymodule+2)AnyDigitalport9STB4Strobe4(nextdisplaymodule+3)AnyDigitalport10STB5Strobe5(nextdisplaymodule+4)AnyDigitalportOutput2x5pinhe derPinnrNameDescription1VCC5V2GNDGround3CLKClock4DIODatain5STB1Strobe1(nextdisplaymodule)6STB2Strobe2(nextdisplaymodule+1)7STB3Strobe3(nextdisplaymodule+2)8STB4Strobe4(nextdisplaymodule+3)9STB5Strobe5(nextdisplaymodule+4)10NCNotconnectedThis2x5pinheaderisusedtoconnecttooutputyoursignaltothenext8x8SEGdisplaythroughaflatcable(daisychaining).TheconnectionstotheArduinoaremadeonthefirstdisplay.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.17630.4. Li r riesneededfor8Digits7-SegmentDispl ywithTM1638chip• TM1638LEDDriverlibraryfromRicardoBatistarjbatista@gmail.com.https://code.google.com/p/tm1638-library/Li r ryuseexpl n tion#include Include TM1638 LED Driver library. TM1638 mymodule(DIO, CLK, STR0); Create 'mymodule' a new instance of the object type TM1638. DIO, CLK and STR0 are Integer values corresponding to the Arduino Digital Output to which DIO, CLK and STR0 are connected. mymodule.setDisplayToDecNumber(1234); Display 1234 on the 8x8 SEG display. module.clearDisplay(); Clear all digits and dots. module.setDisplayToString(" CAFE "); Display the string CAFE in the middle of the display. Not all characters are readable on a 8x8 display. Aswithotherlibraries,informationaboutothermethods(functions)youcanuse,canbefoundinthecorrespondinglibraryheaderfiles*.hinthelibraryfolders.

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArduinodocumentation1.12.17730.5. S mple8Digits7-SegmentDispl ywithTM1638chipThissketchrepeatedlycountsdownfrom10to0(notveryaccurate),thenblinksthetextCAFE.S mpleconnections• ConnectVCCwith5V.• ConnectGNDwithGND.• ConnectCLKwithD9• ConnectDIOwithD8• ConnectSTB0withD7S mplesketch#include TM1638 module(8, 9, 7); long value = 1000; void setup() { module.setDisplayToDecNumber(value, 4); delay(1000); } void loop() { module.setDisplayToDecNumber(value, 4); delay(7); value--; if (value<0) { value=1000; for (int count=0;count<4;count++) { module.clearDisplay(); delay(100); module.setDisplayToString(" CAFE "); delay(100); } module.setDisplayToDecNumber(value,4); delay(1000); } }

©ErikVerberne(erik@verberne.net)http://bit.ly/eve_arduinoArdquotesdbs_dbs14.pdfusesText_20