1.

What does the analogRead() function do physically when invoked in a code?(a) It accepts a digital Input(b) Reads the raw voltage value(c) Activates the ADC Circuit to read voltage values(d) Activates the DAC Circuit to read voltage valuesThis question was posed to me in a job interview.Origin of the question is Board Pinout Structure in section Board Specifications and Types of Arduino

Answer»

Correct option is (c) Activates the ADC Circuit to read voltage values

Easiest explanation: The Arduino has an onboard ADC (Analog to Digital Convertor) Circuit which when INVOKED by the analogRead() function, takes the voltage from the PIN that is SPECIFIED by the program and compares them with the threshold value (5V on the Arduino UNO, 7V on the Arduino Mini and NANO, etc.) and then provides a value ranging from 0 to 1023.



Discussion

No Comment Found

Related InterviewSolutions