Arduino Sensors Beginners Guide (1)

Transcription

willneed1. ldallworkthesamesoifyoualreadyhaveone,great.2. ecommendsomethinglikethis.

Thiswillcostyouabout5dollarsonline.3. oard.

4. hthisonearethemiddletwobigpincolumns(columna- ‐eandcolumnf- rduino5vport)intooneoftherows.

edoes.

portontheArduino.

c.it’sprobablyadigitalsensor.Sensorsliketheseare

ndtheotherislabeled- havelabeledpins,trysomethinglikethis.

setupshouldlooksomethinglikethis.

soitshouldbeabletoexplainwhatitisdoingprettywell.

intsensorPin eading ggiventosensorPinbythesensor.floatvoltage tageisourreading*5voltage/ tforasecondsowedon'tgettoomuchdatatoofast.}

lcircuitboardand2ofthepinsarelabeledSand- somethinglikethis.

pyoursensor.

constintsensorPin sensorPin,wemeandigitalpin2.constintledPin soconnectedtothispin.intsensorState buttonvalue:sensorState eanddefiningitaswhateverstatesensorPinisin.

if(sensorState anymorequestions,feelfreetoe- !

Arduino(SensorBeginners(Guide(( (is(an(easy(to(use,(cheap,(ver