1. ADC Applications- Arduino

Rayo wants to read the proximity sensor value, which provides a voltage output between 0V and 12V for a distance range of 0cm to 10 cm (as indicated in the below graph).

Analyze the code and circuit. What will be printed on the Serial Monitor?

void setup() {
  Serial.begin(9600);
}

void loop() {
  int analogValue = analogRead(A0);
  Serial.println(analogValue);
 
  float voltage = analogValue / 82.75;
  Serial.println(voltage);
 
  while(1);
}


 

Select Answer