/****************************************************************************** QRD1114_Proximity_Example.ino Example sketch for SparkFun's QRD1114 Reflectance Proximity Sensor (https://www.sparkfun.com/products/246) Jim Lindblom @ SparkFun Electronics May 2, 2016 Modified by Adrián Torres Omaña Fab Lab León Phototransistor IR Fab-Xiao ******************************************************************************/ const int Sensor = 26; // analog input pin RP2040 pin 26 or ESP32-C3 pin A0 void setup() { Serial.begin(115200); pinMode(Sensor, INPUT); } void loop() { // Read in the ADC and convert it to a voltage: int proximityADC = analogRead(Sensor); float proximityV = (float)proximityADC * 1000.0 / 1023.0; Serial.println(proximityV); delay(100); }