Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab no. 1: Digital Input Duration: 1 weeks, requires preparation of the results report at the end. 2-Digital input +5v -c Pin 10KR This is

image text in transcribed

Lab no. 1: Digital Input Duration: 1 weeks, requires preparation of the results report at the end. 2-Digital input +5v -c Pin 10KR This is the simplest form of input with only two possible states: on or off. This example reads a simple switch or pushbutton connected to pin2. When the switch is closed the input pin will read HIGH and turn on an LED. int ledPin = 13; // output pin for the LED int inPin = 2; // input pin (for a switch) void setup() { pinMode(ledPin, OUTPUT); // declare LED as output pinMode(inPin, INPUT); // declare switch as input } void loop() { if (digitalRead(inPin) HIGH) // check if input is HIGH { digitalWrite(ledPin, HIGH); // turns the LED on delay(1000); 1/ pause for 1 second digitalWrite(ledPin, LOW); 11 turns the LED off delay(1000); 1/ pause for 1 second } } Discussion 1. What Pinmode stands for? 2. Make the delay in above programming for 2 minutes. 3. Give possible application for above programming

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

Language in Context?

Answered: 1 week ago