资源描述:
《arduino spooky projects class2》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、SpookyProjectsIntroductiontoMicrocontrollerswithArduinoClass214Oct2006-machineproject-TodE.KurtWhat’sforToday•Readingbuttons•Readinganalogvalues(knobsandphotocells)•Detectingthedark•MorecomplexLEDcircuitsAlso,anyquestionsaboutlastweek?OraboutstuffontheArd
2、uinosite?Recap:BlinkyLEDRecap:ProgrammingEditCompileResetUploadKnownGoodConfigurationRule#1ofexperimenting:Beforetryinganythingnew,GetbacktoaknownworkingstateSolet’sspendafewminutes&get“led_blink”workingagainGetyourentireedit->compile->upload->runworkingEv
3、enifitbecomessosecondnaturetoyouthatyoufeelyoushouldn’tneedto,doitanyway.Especiallywhenmysteriousproblemsarise,reverttoaknownstateLEDLightTubesSnug-fitstrawsontheendofyourLEDstomakethemglowmorevisiblyIhaveaboxofmulti-coloredstrawsforwhatevercolorLEDyoulike
4、DigitalInputMostinputsyou’llusearevariationsonswitchesSwitchesmakeorbreakaconnectionknifeswitchtoggleswitch(SPST)(SPDT)Fundamentally,they’realllikethesimpleknifeswitchSinglepole=onlyonecircuitisbeingcontrolledDoublepole=twocircuitsarebeingcontrolledatonce
5、Singlethrow=onlyonepathforcircuitDoublethrow=twopotentialpathsforcircuitManyKindsofSwitchesmagnetichexidecimaltiltleverTiltsensorhasalittleballinsideyoucanhear.Usedtohavemercuryswitches,withrealmetallicmercuryinside.Notsomuchnowtho’.Magneticreedswitchesar
6、ecool,butdelicate.Thehexswitchisactuallymanyswitchesinone,andoutputs4signalsTinySwitches“gap”connectwhenpushedalwaysconnectedtogetherPressingthebutton,“closesthegap”Thesearetheswitchesinyourkit.Oneshouldhaveaslightlydi!erentbuttononitthantheother.MakeYour
7、OwnSwitches•Anythingthatmakesaconnection•Wires,tinfoil,tinfoilballs,ballbearings•Pennies!•Nails,bolts,screws•OrrepurposethesetinyswitchesasbumpdetectorsorclosuredetectorsHomemadeSwitches“TrickPenny”Pennyonasurface.Whenthepennyislifted,alarmsgooffHomemadeS
8、witches“TrickPenny”Wiresolderedtopenny.Wireloopedorcrimpedtoaluminumsheet.HomemadeSwitches“SmartWindChimes”Whenthewindblowshardenough,you’resentemailShouldusestrandedwire,notsolid.Codeanalyzesseriesofon/o!/on/o!puls