Arduino Course Final Exam Min
Time : 45
Choose the best answer for each question :1. Which of these can an Arduino NOT be used for? a. controlling servos b. displaying analog inputs c. building robots d. an Arduino can be used to do all of these 2. What are the Arduino’s two main program structures? a. setup and loop b. main and setup c. loop and main d. int and setup 3. How man ana!og ports does an Arduino ha"e? a. five, and they are labeled A1-A5 b. six, and they are labeled A0-A5 c. six, and they are labeled A1-A6 d. five, and they are labeled A0-A4 #. Which of these is a digita! input de"ice? a. pressure sensor b. servo c. button d. potentiometer $. Which of these is an ana!og input de"ice? a. pressure sensor b. servo c. button d. !" %. Which of these is an output de"ice? a. pressure sensor b. servo c. button d. potentiometer &. What command wou!d ou use to te!! the Arduino that there is an output on port '? a. int sensorPin = 9; b. int sensorValue = 9;
c. digitalWrite(9, HIGH); d. pinMode(9, OUTPUT); (. What command wou!d ou use to !ight up an )*+ on port $? a. int sensorPin = A; b. int sensorValue = ; c. digitalWrite(!, HIGH); d. pinMode(!, OUTPUT); '. How wou!d ou pause a program for 2.$ seconds? a. dela"(#!) b. int sensorValue = ; c. dela"(#$!); d. pinMode(ledPin, OUTPUT); 1,. How do ou read "a!ues from the Arduino on the computer screen? a. the #$ie%& button b. the #'erial (onitor& button c. the #)pload& button d. you cannot read values from the Arduino on the screen 11. What is the command for p!aing a musica! note on the Arduino? a. tone(); b. pla"(); c. note(); d. sound(); The -uestions in the net section are answered b referring to the fo!!owing program/ int sensorPin = A; int ledPin = %&; int sensorValue = ; 'oid setup() pinMode(ledPin, OUTPUT); 'oid loop() sensorValue = analog*ead(sensorPin); digitalWrite(ledPin, HIGH); dela"(sensorValue); digitalWrite(ledPin, +OW); dela"(sensorValue); 12. What is the purpose of !ine #? a. *o begin the setup program structure b. *o begin the loop program structure c. *o set the input value of port 1+ to #& d. line 4 has no function in the program • • • • • • • • • • • • •
13. What is the purpose of !ine '?
a. *urns off the !" plugged into pin 0 b. *urns on the !" plugged into pin 1+ c. *urns off the !" plugged into pin 1+ d. *urns on the !" plugged into pin 0 1#. What is the purpose of !ine $? a. *o begin the setup program structure. b. t turns on the !" plugged into port 1+. c. *o set port 1+ to an output. d. ine 5 has no function in the program. 1$. What does this program do when it is up!oaded to the Arduino? a. t blin/s an !" based on the value of an analog input. b. t %rites the value of an analog input to the screen. c. t changes the brightness of an !" based on the value of an analog input. d. t blin/s an !", %ith no input from analog sources. 1%. 0te stores an ...... numerica! "a!ue without decima! points. The ha"e a range of ,2$$. a. 4-bit . b. -bit . c. 16-bit . d. +-bit . 1&. nteger "ariab!es wi!! ro!! o"er if forced past their maimum or minimum "a!ues b an assignment or comparison. or eamp!e4 if 5 32&%& and a subse-uent statement adds 1 to 4 5 6 1 or 664 wi!! then ro!!o"er and e-ua! 77. a. -+262. b. +,26. c. -+,26 . d. +262. 1(. or f!oatingpoint numbers4 or numbers that ha"e a decima! point. !oating point numbers ha"e greater reso!ution than integers and are stored as a 7.. "a!ue a. 4-bit . b. -bit . c. 16-bit . d. +-bit . 1'. int mArra8$9: ;; dec!ares integer arra w; 77 positions a. 0 . b. 4 . c. 5 . d. 6 . 2,. mArra839 5 1,: ;; assigns the 77 inde the "a!ue 1, a. + . b. 4 . c. 5 . d. 10 . 21. Arduino digita! pins defau!t to 77 4 so the don.
a. Analog . b. "igital . c. nput . d. utput . 22. @ins configured as OT@T are said to be in a !owimpedance state and can pro"ide 7.. of current to other de"ices;circuits. a. 0 mA . b. +0 mA . c. 40 mA . d. 50 mA . 23. ana!ogBead>pin Beads the "a!ue from a specified ana!og pin with a 7. reso!ution. a. -bit . b. 10-bit . c. 1-bit . d. 16-bit . 2#. ana!ogWrite>pin4 "a!ue Writes a pseudoana!og "a!ue using hardware enab!ed pu!se width modu!ation >@W= to an output pin marCed @W=. The "a!ue can be specified as a "ariab!e or constant with a "a!ue from 77 a. 0 - 5 . b. 0 - 1+ . c. 0 - 10+ . d. 0 - 55 . 2$. The tpica! baud rate for communicating with the computer is 7.. a!though other speeds are supported. a. 400 . b. 3600 . c. +400 . d. 11500 . 2%. When using seria! communication4 digita! pins ...... cannot be used at the same time. a. 0 1 . b. 0 1+ . c. + . d. 1 1+ . 2&. The Arduino no can be powered "ia the D0 connection or with an eterna! power supp!. The power source is se!ected automatica!!. The board can operate on an eterna! supp! of 77 "o!ts. a. 0 to 5 . b. 0 to 3 . c. 5 to 3 . d. 6 to 0 . 2(. @W=/ 34 $4 %4 '4 1,4 and 11. @ro"ide 7. @W= output with the ana!ogWrite> function. a. -bit . b. 10-bit .
c. 1-bit . d. 16-bit .
Write short notes about the followin :1 Arduino ad"antages o"er other microcontro!!ers . 2 Eompare between Arduino no and Arduino =ega 2$%, . 3 +E motor 4 Der"o motor 4 Dtepper motor . # A+Es parameters . $ +escribe brief! how can ou maCe our own Arduino .
Ex!lain in detail this !roram :"# $include %&iquidCr'stal#h( )# &iquidCr'stal lcd*+, , ., "/, "", ")01 2# int analo3n!ut /1 4# float out /#/1 5# float in /#/1 6# float 7" "/////#/1 88 resistance of 7" *"//90 +# float 7) "////#/1 88 resistance of 7) *"/90 # int alue /1 .# oid setu!*0 "/# !inMode*analo3n!ut, 3;<=T01 ""# lcd#bein*"6, )01 ")# lcd#!rint*>?C @&TMETE7>01 "2# B "4# oid loo!*0 "5# alue analo7ead*analo3n!ut01 "6# out *alue 5#/0 8 "/)4#/1 "+# in out 8 *7)8*7"D7)001 "# if *in%/#/.0 ".# in/#/B )/# lcd#setCursor*/, "01 )"# lcd#!rint*>3;<=T @ >01 ))# lcd#!rint*in01
)2# )4#
dela'*5//01 B