Problem 4 1[15 points] Answer the questions, censidering the pregram below. sent
ID: 3349543 • Letter: P
Question
Problem 4 1[15 points] Answer the questions, censidering the pregram below. sentence amswers please. 1 void setupo ( 5 void loop) ( int sensorValue analogRead(AD) int outputValue map(sensorValue. 0, 1023, 0, 255) 8 analogWrite(9, outputValue) 10 Serial printsensor 11 Serial print(sensorValue), 12 Serial printt output 13 Serial printin(outputValue) 14 delay(2): 15 I. What is the purpose of 9600 in Line 2? II. What does A0 in Line 6 refer to? III. What is the effect of lt in Line 12? IV. How would you modify the program if Serial printin (Line 13) was not available and you still wanted the same result? V. What does this program do when uploaded to our Arduino? Page 5 of 6Explanation / Answer
I. For communication with computer we have to set a rate known as baud rate.9600 is the baud rate (bits/second) for serial data transmission
II. A0 is the analog pin number on the arduino baord
III. is for horizontal tab..means it prints the value after 5 spaces.
IV. Serial.println is used to print the quoted value on the computer monitor..using output=createWriter(value) and output.println(value), in place of serial.println we can diaplay values on monitor.
V. Firat the sensor value qill get the input from the analog pin A0. The output value is set to the mapping of low to high values of sensor value.after that we are writing the outpur value on 9th pin. Amd next task is to just print the values as
Sensor= " the value of the sensor will be printed"
Output= " the output value will be printed"
Next the program is waited for 2 milliseconds.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.