Hello @sbollaerts
there is only one analog input available on the M5Atom Matrix: GPIO34 which is shared with GPIO23.
Please check out M5AtomMatrix Schematic
In order to use the analog input you'll need to set GPIO34 as input and disable pullup/pulldown resistors of GPIO23.
Below code works for me:
#include <M5Atom.h>
void setup()
{
M5.begin(true, false, true);
pinMode(GPIO_NUM_34, INPUT);
gpio_pulldown_dis(GPIO_NUM_23);
gpio_pullup_dis(GPIO_NUM_23);
}
void loop()
{
Serial.printf("GPIO34: %d\n", analogRead(GPIO_NUM_34));
delay(1000);
}
Update: I just realised that GPIO33 can also be used as analog input.
pinMode(GPIO_NUM_33, INPUT);
Serial.printf("GPIO33: %d\n", analogRead(GPIO_NUM_33));
Cheers
Felix