@Arn_8 I am not familiar with this camera or AI. Have you been able to connect to it and read it?
The Pi would need SoftwareSerial UART and I suppose some app on the Pi to interpret the results.
I assume you have been to this site?
https://github.com/m5stack/M5-ProductExampleCodes/blob/master/App/UnitV/track_ball/track_ball.ino
Hope this helps!
A