ThemiddlewireisforgroundthatwillgotothegroundconnectionontheArduinoboardandthenforthesensorwireforthisparticularproject, thiswillbegoingto a zerosensebegoingtotheanalogside.
Doyourememberthedigitalside?
Hislongdecidesalongtherighthandsidehere.
Theanalogsideisthesmallersection, andthat's belowthepowerconnectorsweregonnabepluggingthisinto a zeroontheanalogside, andthat's allthereistoewiringthisthingup.
Solet's gotake a lookatthecode.
Sohere's a verysimplecodeforthisparticularproject.
Thefirstthingthatweneedtodoisweneedtodefinetheinfraredsensorpensowe'regoingtodopound, define I R.
Soallwe'regoingtodohereiswe'regoingtotakethatvariablereading, andwe'regonnamakethevalueofthatvariablereadinganaloggreedfunctionWhateveriscominginthroughthe I.