Internet of Things and its Applications

Building IoT Applications - Set 2

  1. The keyword „PROGMEM‟ is a variable modifier of PROGMEM Utility. Which header file contains it?
    1. avr/pspace.h
    2. avr/pgmspace.h
    3. avr/pmspace.h
    4. avr/progmem.h
    Answer : B
    Explain : The keyword "PROGMEM" is a variable modifier of the PROGMEM Utility. The PROGMEM Utility is contained within the avr/pgmspace.h header file.
  2. Choose the correct option of C program having array:
     int main () 
     { 
     int xyz  = [10,20,30,40]; 
    printf (“%d”, xyz (1));
     }
    
    1. 0
    2. 10
    3. 20
    4. Compile error
    Answer : C
    Explain : To Access the array we use [] brackets. Here printf("%d", xyz[1]); is way to access the array second value.
  3. LCD displays the text form of data when EN line shows __________ and RS line is__________:
    1. 0 to 1 transitions & High
    2. 1 to 0 transitions & High
    3. 0 to 1 transitions & Low
    4. 1 to 0 transitions & Low
    Answer : B
    Explain : 1 -0 means Sends information to LCD.
  4. Arduino can be programmed using following languages:
    1. C++
    2. Python
    3. Java
    4. None of these
    Answer : A
    Explain : Arduino can be programmed using the Arduino programming language, which is based on C and C++.
  5. Which macro confirms “Hello friend” will be stored in the Flash memory:
    1. Serial. Print (F (“Hello Friend”));
    2. Serial. Print (A (“Hello Friend”));
    3. Serial. Print (C (“Hello Friend”));
    4. Serial. Print (N (“Hello Friend”));
    Answer : A
    Explain : In Arduino, the Serial.print() function prints data to the serial port. The F() macro tells the compiler to store the parameter in the flash memory instead of the SRAM. For example, Serial.print(F("Hello World")).
  6. The difference in If-Else and switch case statement is:
    1. If-Else enforces binary search
    2. Switch-case enforces linear search
    3. Multiple statements can be used for numerous decisions inside If-Else
    4. Multiple statements can be used for numerous decisions inside If-Else
    Answer : C
  7. Sketches in Arduino are saved with the extension ___________.
    1. .exe
    2. .ino
    3. .ide
    4. .doc
    Answer : B
    Explain : Sketches in Arduino are saved with the file extension .ino. Sketches are programs written in the Arduino Software (IDE).
  8. The speed of DC motor is controlled by Arduino using ____________.
    1. PCM
    2. PPM
    3. PWM
    4. QAM
    Answer : C
    Explain : The speed of a DC motor can be controlled by Arduino using Pulse Width Modulation (PWM). The Arduino can generate PWM signals on its digital output pins. The Arduino has 6 PWM output pins and internal hardware to drive them. The speed of the motor can be varied by passing a value between 1 and 254. If you pass 0, the motor will stop, and if you pass 255, it will run at full speed.
  9. A constant variable can be declared as:
    1. only in variable declaration area
    2. After main ()
    3. const number int
    4. #define number 35
    Answer : D
  10. Choose the correct option to access the 4th element of the array :
    int z [30];
    int *pz;
    pz = z;
    1. *(z+3)
    2. z [3]
    3. pz [3]
    4. *(*pz+3)
    Answer : C
    Explain : Value starts from 0 and the fourth elment value is on 3 number.
  11. How many pwm pins does the Arduino Uno have?
    1. 1
    2. 2
    3. 4
    4. 6
    Answer : D
    Explain : The Arduino Uno has six PWM pins: 3, 5, 6, 9, 10, 11.
  12. What is the Optiboot bootloader in the Arduino IDE?
    1. Default bootloader
    2. ATmega328p
    3. Both (A) and (B)
    4. Takes 1024 bytes for initiating
    Answer : A
    Explain : The default bootloader of the Arduino Uno is the Optiboot bootloader. The bootloader is the little program that runs when you turn the Arduino on, or press the reset button.
  13. In a function, an array is passed by:
    1. Address relocation
    2. Call by value
    3. Function arguments
    4. Call by reference
    Answer : D
  14. An array index, xyz [ ] starts with _____.
    1. -1
    2. 0
    3. 1
    4. 2
    Answer : B
    Explain : An array index starts with value -0.
  15. Which parameter is taken through pulseIn() in ultrasonic sensor?
    1. Voltage
    2. Frequency
    3. Time duration
    4. Distance
    Answer : C
    Explain : The pulseIn() function in Arduino takes the following arguments: The pin from which to read the pulse duration, The type of pulse to be read and The timeout.

Next Set

1 3