Please answer the questions based on the figure below! a. Which pin number is assigned to the
Fantastic news! We've Found the answer you've been seeking!
Question:
Please answer the questions based on the figure below!
a. Which pin number is assigned to the input of the system?
b. Explain the function of the code on line 9! digitalWrite(inPin, HIGH);
c. What is the voltage value at pin no. 2 if the button is pressed? Explain!
Transcribed Image Text:
Sketch 1 2 3 4 5 6 7 8 pinMode(inPin, INPUT); 9 digitalWrite(inPin, HIGH); pinMode(ledPin, OUTPUT); 10 11 Serial.begin(9600); 12 13 14 15 16 17 const int ledPin = 13; const int inPin = 2; const int debounceTime = 20; int count = 0; 2222 void setup() { CIRCUIT } void loop() { int duration = switchTime(); 18 19 20 { if (duration > debounceTime) {count = count + 1; digitalWrite(ledPin, HIGH);} else 21 if( count = 0) digitalWrite(ledPin, LOW); 23 else 24 { ∞ UNO digitalWrite(ledPin, HIGH); 25 26 count == 0; 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 } } Serial.println(count); delay(100); } long switchTime() { static unsigned long startTime = 0; static boolean state; if(digitalRead(inPin) != state) { state = state; startTime = millis(); } if( state == LOW) return millis() else return 0; } startTime; Sketch 1 2 3 4 5 6 7 8 pinMode(inPin, INPUT); 9 digitalWrite(inPin, HIGH); pinMode(ledPin, OUTPUT); 10 11 Serial.begin(9600); 12 13 14 15 16 17 const int ledPin = 13; const int inPin = 2; const int debounceTime = 20; int count = 0; 2222 void setup() { CIRCUIT } void loop() { int duration = switchTime(); 18 19 20 { if (duration > debounceTime) {count = count + 1; digitalWrite(ledPin, HIGH);} else 21 if( count = 0) digitalWrite(ledPin, LOW); 23 else 24 { ∞ UNO digitalWrite(ledPin, HIGH); 25 26 count == 0; 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 } } Serial.println(count); delay(100); } long switchTime() { static unsigned long startTime = 0; static boolean state; if(digitalRead(inPin) != state) { state = state; startTime = millis(); } if( state == LOW) return millis() else return 0; } startTime;
Expert Answer:
Posted Date:
Students also viewed these electrical engineering questions
-
The basic monthly salary of Freddy is R10 000. She is entitled to an annual bonus of R9 000. Her employer contributes R9 000 per annum to her pension fund. She works for 9 hours per day from Monday...
-
Answer the questions based on these two annual reports. (Auckland Airport )https://corporate.aucklandairport.co.nz/investors/results-and-reports(2018 Financial Statements) (Air New Zealand)...
-
Answer the questions based on concept and your understanding of how the budget numbers are interrelated. Assume each of the following questions is an independent situation. A. what would be the...
-
Problem 8-46 (LO. 2, 4, 9) Dennis Harding is considering acquiring a new automobile that he will use 100% for business in the subsequent year. The purchase price of the automobile would be $54,500....
-
A Monster.com poll of 3057 individuals asked: Whats the longest vacation you plan to take this summer? The following relative frequency distribution summarizes the results. ResponseRelative Frequency...
-
A mixture containing 65.0 mole% acetone (Ac) and the balance acetic acid (AA) is separated in a continuous distillation column at 1 atm. A flowchart for the operation is as follows: The overhead...
-
Indicate whether each of the following descriptions is more characteristic of a centralized (C) or decentralized (D) company. Description 1. Hires highly motivated employees 2. Prioritizes training...
-
The following selected transactions were taken from the records of Shaw Company for the first year of its operations ending December 31, 2008: Jan. 31. Wrote off account of B. Roberts, $2,400. Mar....
-
n = 49 x bar= 54.8 standard deviation = 28 H0: = 50 Ha: does not =50 The p-value is equal to A. 0.1151 B. 0.3849 C. 0.2698 D. 0.2302
-
Mike's car has an actual cash value of $10,000. While driving to class, at GBC, Mike was involved in an accident and is 25% responsible. The car is a total loss. If Mike has optional loss coverage,...
-
Lucy wants to retire at the age of 60 with a monthly income of $7,500. She expects to live to 95. She has no children, so she wants to exhaust her savings immediately before she dies. She expects...
-
Explore and discuss the impact of an integrated management system on organizational performance, including its influence on operational efficiency, risk management, cost - effectiveness, and overall...
-
part A- You find that if you place charges of 1.50 C on two separated metal objects, the potential difference between them is 10.8 V. What is their capacitance? Express your answer with the...
-
How can technology-enabled collaboration platforms and virtual team environments impact team dynamics, and what strategies can teams implement to overcome the challenges of remote work and leverage...
-
Water, initially saturated vapor at 14.6 bar, fills a closed, rigid container. The water is heated until its temperature is 200C. For the water, determine the heat transfer, in kJ/kg. Kinetic and...
-
How does lean production impact the overall safety and risk management practices within an organization?
-
02 No Fig. 1: The two-dimensional revolute manipulator of problem 1 Problem 1 Robotic manipulators are found throughout manufacturing and assembly plants. A simple robotic manipulator is a...
-
A 6-lb shell moving with a velocity ?? v0k explodes at point D into three fragments which hit the vertical wall at the points indicated. Fragments A, B, and C hit the wall 0.010 s, 0.018 s, and 0.012...
-
While designing a mixer-settler extraction system, you obtain a mass transfer correlation from a book. Unfortunately, the book does not explain which model was used. Which model would you use to...
-
Explain why mass transfer correlations for co-flow cannot be used for countercurrent flow.
-
Why are mass transfer coefficients from clean drops higher than mass transfer coefficients in dirty systems? What is the practical significance of this?
Study smarter with the SolutionInn App