I have a simple sketch
uint32_t timestamp = millis();
void setup()
{
SerialUSB.begin(115200);
while(!SerialUSB || millis() - timestamp < 2000) ;
analogReadResolution(12);
SerialUSB.println("Starting\n");
}
void loop()
{
SerialUSB.printf("A1 %u\n", analogRead(PIN_A1));
SerialUSB.printf("A2 %u\n", analogRead(PIN_A2));
SerialUSB.printf("A3 %u\n", analogRead(PIN_A3));
SerialUSB.printf("A4 %u\n", analogRead(PIN_A4));
delay(500);
}
Whose sole responsibility is to output the readings from each of the identified ANALOG pins. Nothing is connected to the XIAO, other than the USB to provide power and get access ot the Serial port.
With nothing connected to any of the XIAO pins, I would expect to get constant readings of 0 from each Analog pin, however I get the following: