DigitalReadSerial - Serial.begin(9600); pinMode(2, INPUT);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* DigitalReadSerial Reads a digital input on pin 2, prints the result to the serial monitor This example code is in the public domain. */ void setup() {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Serial.begin(9600); pinMode(2, INPUT); } void loop() { int sensorValue = digitalRead(2); Serial.println(sensorValue, DEC); }...
View Full Document

Ask a homework question - tutors are online